diff options
author | guido <guido@FreeBSD.org> | 1998-03-06 19:00:26 +0000 |
---|---|---|
committer | guido <guido@FreeBSD.org> | 1998-03-06 19:00:26 +0000 |
commit | 7322781b5012476cd36d13cae8a57280c2c680c0 (patch) | |
tree | ac4f99790002c5d845e7aaa5aad6ed61cc6a9002 /gnu/usr.bin/sort | |
parent | db9e91b2d346f317561ff9387ee1df2e285cf4ff (diff) | |
download | FreeBSD-src-7322781b5012476cd36d13cae8a57280c2c680c0.zip FreeBSD-src-7322781b5012476cd36d13cae8a57280c2c680c0.tar.gz |
Open temporary files with O_EXCL.
Obtained from:bugtraq
Diffstat (limited to 'gnu/usr.bin/sort')
-rw-r--r-- | gnu/usr.bin/sort/sort.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/usr.bin/sort/sort.c b/gnu/usr.bin/sort/sort.c index 9457e94..1faee42 100644 --- a/gnu/usr.bin/sort/sort.c +++ b/gnu/usr.bin/sort/sort.c @@ -369,7 +369,7 @@ xtmpfopen (const char *file) FILE *fp; int fd; - fd = open (file, O_WRONLY | O_CREAT | O_TRUNC, 0600); + fd = open (file, O_EXCL | O_WRONLY | O_CREAT | O_TRUNC, 0600); if (fd < 0 || (fp = fdopen (fd, "w")) == NULL) { error (0, errno, "%s", file); |