projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a991132
)
(xtmpfopen): Open temporary file exclusively, to
author
Jim Meyering
<jim@meyering.net>
Wed, 11 Mar 1998 11:53:29 +0000
(11:53 +0000)
committer
Jim Meyering
<jim@meyering.net>
Wed, 11 Mar 1998 11:53:29 +0000
(11:53 +0000)
foil a common denial-of-service attack.
From Paul Eggert.
src/sort.c
patch
|
blob
|
history
diff --git
a/src/sort.c
b/src/sort.c
index
cbcbff1
..
fd1f4d0
100644
(file)
--- a/
src/sort.c
+++ b/
src/sort.c
@@
-346,7
+346,7
@@
xtmpfopen (const char *file)
FILE *fp;
int fd;
- fd = open (file, O_WRONLY | O_CREAT | O_TRUNC, 0600);
+ fd = open (file, O_WRONLY | O_CREAT | O_TRUNC
| O_EXCL
, 0600);
if (fd < 0 || (fp = fdopen (fd, "w")) == NULL)
{
error (0, errno, "%s", file);