diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-05-20 19:58:04 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-05-20 19:58:04 +0000 |
commit | b7f424bf063934bb2d18aaa8573e5c818abcd8e7 (patch) | |
tree | 96e9878006f0de1b63b60098c2d941e95b7e1ec1 /usr.bin | |
parent | 3d89f86f80c6955e03f7e59d31029b021b6f1241 (diff) |
cvs_noexec checks; jfb ok
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/cvs/remove.c | 4 | ||||
-rw-r--r-- | usr.bin/cvs/resp.c | 29 |
2 files changed, 18 insertions, 15 deletions
diff --git a/usr.bin/cvs/remove.c b/usr.bin/cvs/remove.c index 604a20bac90..370c51dc98e 100644 --- a/usr.bin/cvs/remove.c +++ b/usr.bin/cvs/remove.c @@ -1,4 +1,4 @@ -/* $OpenBSD: remove.c,v 1.13 2005/05/12 14:04:13 xsa Exp $ */ +/* $OpenBSD: remove.c,v 1.14 2005/05/20 19:58:03 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * Copyright (c) 2004 Xavier Santolaria <xsa@openbsd.org> @@ -112,7 +112,7 @@ cvs_remove_file(CVSFILE *cf, void *arg) if (root->cr_method != CVS_METHOD_LOCAL) { /* if -f option is used, physically remove the file */ - if (force_remove == 1) { + if ((force_remove == 1) && !cvs_noexec) { if((unlink(fpath) == -1) && (errno != ENOENT)) { cvs_log(LP_ERRNO, "failed to unlink `%s'", fpath); diff --git a/usr.bin/cvs/resp.c b/usr.bin/cvs/resp.c index d50ca15d3ec..56f10ebd6f5 100644 --- a/usr.bin/cvs/resp.c +++ b/usr.bin/cvs/resp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: resp.c,v 1.34 2005/05/19 04:17:24 jfb Exp $ */ +/* $OpenBSD: resp.c,v 1.35 2005/05/20 19:58:03 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -346,20 +346,23 @@ cvs_resp_statdir(struct cvsroot *root, int type, char *line) return (-1); } - if ((type == CVS_RESP_CLRSTATDIR) && - (unlink(statpath) == -1) && (errno != ENOENT)) { - cvs_log(LP_ERRNO, "failed to unlink %s file", - CVS_PATH_STATICENTRIES); - return (-1); - } else if (type == CVS_RESP_SETSTATDIR) { - fd = open(statpath, O_CREAT|O_TRUNC|O_WRONLY, 0400); - if (fd == -1) { - cvs_log(LP_ERRNO, - "failed to set static directory on %s", line); + if (!cvs_noexec) { + if ((type == CVS_RESP_CLRSTATDIR) && + (unlink(statpath) == -1) && (errno != ENOENT)) { + cvs_log(LP_ERRNO, "failed to unlink %s file", + CVS_PATH_STATICENTRIES); return (-1); - } - (void)close(fd); + } else if (type == CVS_RESP_SETSTATDIR) { + fd = open(statpath, O_CREAT|O_TRUNC|O_WRONLY, 0400); + if (fd == -1) { + cvs_log(LP_ERRNO, + "failed to set static directory on %s", + line); + return (-1); + } + (void)close(fd); + } } return (0); |