diff options
author | Tim van der Molen <tim@cvs.openbsd.org> | 2015-10-13 16:55:04 +0000 |
---|---|---|
committer | Tim van der Molen <tim@cvs.openbsd.org> | 2015-10-13 16:55:04 +0000 |
commit | 960e76b3eb15143ec61ce3eacb8f45c62f4be695 (patch) | |
tree | 0a28733990ad1fad083ee8e918fd2132094fdffe | |
parent | c8d5db2d0b634eea49e6cef09dbfc507da06ab4c (diff) |
Ignore the setuid/setgid/sticky bits when copying the permissions of an input
file to the new output file. In preparation for pledge(2).
Suggested by and OK millert@
-rw-r--r-- | usr.bin/sort/sort.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c index bb0178cb90d..c0305db5d9c 100644 --- a/usr.bin/sort/sort.c +++ b/usr.bin/sort/sort.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sort.c,v 1.80 2015/10/13 16:21:42 tim Exp $ */ +/* $OpenBSD: sort.c,v 1.81 2015/10/13 16:55:03 tim Exp $ */ /*- * Copyright (C) 2009 Gabor Kovesdan <gabor@FreeBSD.org> @@ -1133,7 +1133,7 @@ main(int argc, char *argv[]) sort_asprintf(&outfile, "%s.XXXXXXXXXX", real_outfile); if ((fd = mkstemp(outfile)) == -1 || - fchmod(fd, sb.st_mode & ALLPERMS) == -1) + fchmod(fd, sb.st_mode & ACCESSPERMS) == -1) err(2, "%s", outfile); close(fd); tmp_file_atexit(outfile); |