summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorNiall O'Higgins <niallo@cvs.openbsd.org>2007-02-21 18:12:37 +0000
committerNiall O'Higgins <niallo@cvs.openbsd.org>2007-02-21 18:12:37 +0000
commit600ba947788482bfabfe818df594db4d48852c22 (patch)
tree2d2994c7a68ffc90ef2921b7e96e2d7b84243e99 /usr.bin
parentdc96e07546f1da6febc62bd4ba7473cf20d89d76 (diff)
make sure checkout_rev() sets correct file permissions via file->rf_mode
in case where fstat() of file->rf_fd won't give us right mode. fixes PR #5383 ok xsa@
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/rcs/co.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/rcs/co.c b/usr.bin/rcs/co.c
index 5c3940d134a..3888bacb427 100644
--- a/usr.bin/rcs/co.c
+++ b/usr.bin/rcs/co.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: co.c,v 1.102 2007/02/18 20:54:18 xsa Exp $ */
+/* $OpenBSD: co.c,v 1.103 2007/02/21 18:12:36 niallo Exp $ */
/*
* Copyright (c) 2005 Joris Vink <joris@openbsd.org>
* All rights reserved.
@@ -355,6 +355,8 @@ checkout_rev(RCSFILE *file, RCSNUM *frev, const char *dst, int flags,
if (fstat(file->rf_fd, &st) == -1)
err(1, "%s", file->rf_path);
file->rf_mode = mode = st.st_mode;
+ } else {
+ mode = file->rf_mode;
}
if (flags & CO_LOCK) {