mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-05 09:14:03 +00:00
Open temporary files with O_EXCL.
Obtained from:bugtraq
This commit is contained in:
parent
8199f5c431
commit
52ed3a5d65
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=34136
@ -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