diff options
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); |