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/cvs/resp.c | |
parent | 3d89f86f80c6955e03f7e59d31029b021b6f1241 (diff) |
cvs_noexec checks; jfb ok
Diffstat (limited to 'usr.bin/cvs/resp.c')
-rw-r--r-- | usr.bin/cvs/resp.c | 29 |
1 files changed, 16 insertions, 13 deletions
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); |