mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-10 08:22:27 +01:00
Don't unlink the target file if it's not a regular file.
This commit is contained in:
parent
bb2083983f
commit
e2b41a622b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=65277
@ -427,7 +427,8 @@ fetch(char *URL, char *path)
|
||||
goto done;
|
||||
failure:
|
||||
if (of && of != stdout && !R_flag && !r_flag)
|
||||
unlink(path);
|
||||
if (stat(path, &sb) != -1 && (sb.st_mode & S_IFREG))
|
||||
unlink(path);
|
||||
failure_keep:
|
||||
r = -1;
|
||||
goto done;
|
||||
|
Loading…
Reference in New Issue
Block a user