diff options
author | 2007-02-21 18:12:36 +0000 | |
---|---|---|
committer | 2007-02-21 18:12:36 +0000 | |
commit | 0825db650f4003cca9de2563a2732efa37f66eb8 (patch) | |
tree | 79cfee4a3780408180252af02bb4f98046bbdc2d | |
parent | Create "syslogd: restart" message after the setup of signal (diff) | |
download | wireguard-openbsd-0825db650f4003cca9de2563a2732efa37f66eb8.tar.xz wireguard-openbsd-0825db650f4003cca9de2563a2732efa37f66eb8.zip |
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@
-rw-r--r-- | usr.bin/rcs/co.c | 4 |
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) { |