diff options
author | Jim Meyering <jim@meyering.net> | 1998-12-13 19:26:35 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1998-12-13 19:26:35 +0000 |
commit | 7dfd5ca1cd8db43dae50c6f0a5d3038bcc6a0a5f (patch) | |
tree | ec3bec2435b59d9625e1fc149b835520b8198eba /src/sort.c | |
parent | c5195207dba0429aede01fe0b9395f4a261ff9c2 (diff) | |
download | coreutils-7dfd5ca1cd8db43dae50c6f0a5d3038bcc6a0a5f.tar.xz |
add comment about opening exclusively
Diffstat (limited to 'src/sort.c')
-rw-r--r-- | src/sort.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/sort.c b/src/sort.c index 3446abdc9..d6ce76d9c 100644 --- a/src/sort.c +++ b/src/sort.c @@ -340,6 +340,8 @@ xtmpfopen (const char *file) FILE *fp; int fd; + /* Open temporary file exclusively, to foil a common + denial-of-service attack. */ fd = open (file, O_WRONLY | O_CREAT | O_TRUNC | O_EXCL, 0600); if (fd < 0 || (fp = fdopen (fd, "w")) == NULL) { |