summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJoris Vink <joris@cvs.openbsd.org>2005-12-23 00:27:05 +0000
committerJoris Vink <joris@cvs.openbsd.org>2005-12-23 00:27:05 +0000
commit4ae45c6d099b0ff51f45cf1c01f1d24c8e11ffc0 (patch)
tree41fd3f955aec7e3a442e9971cbbb5e81869bc2e6 /usr.bin
parent52a885f709159065261e28b0f84725136c3df9b7 (diff)
cvs_buf_write() did not properly set new permissions
on already existing files. niallo agrees.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/cvs/buf.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/usr.bin/cvs/buf.c b/usr.bin/cvs/buf.c
index 832392901f9..a06d5083213 100644
--- a/usr.bin/cvs/buf.c
+++ b/usr.bin/cvs/buf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: buf.c,v 1.23 2005/12/21 16:03:56 xsa Exp $ */
+/* $OpenBSD: buf.c,v 1.24 2005/12/23 00:27:04 joris Exp $ */
/*
* Copyright (c) 2003 Jean-Francois Brousseau <jfb@openbsd.org>
* All rights reserved.
@@ -399,6 +399,9 @@ cvs_buf_write(BUF *b, const char *path, mode_t mode)
}
(void)close(fd);
+ if (chmod(path, mode) < 0)
+ fatal("cvs_buf_write: chmod failed: %s", strerror(errno));
+
return (0);
}