Open temporary files with O_EXCL.
Obtained from:bugtraq
This commit is contained in:
parent
68b354f908
commit
f2be303d75
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user