summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/xinstall/xinstall.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c
index a173873..15b115a 100644
--- a/usr.bin/xinstall/xinstall.c
+++ b/usr.bin/xinstall/xinstall.c
@@ -953,9 +953,8 @@ install(const char *from_name, const char *to_name, u_long fset, u_int flags)
}
if (mode != (to_sb.st_mode & ALLPERMS)) {
- if (dounpriv)
- mode &= S_IRWXU|S_IRWXG|S_IRWXO;
- if (fchmod(to_fd, mode)) {
+ if (fchmod(to_fd,
+ dounpriv ? mode & (S_IRWXU|S_IRWXG|S_IRWXO) : mode)) {
serrno = errno;
(void)unlink(to_name);
errno = serrno;
OpenPOWER on IntegriCloud