mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-23 13:41:08 +01:00
Try to preserve ownership and permissions when replacing an existing file.
PR: bin/104702 Submitted by: Kevin Day <toasty@dragondata.com> MFC after: 1 week
This commit is contained in:
parent
6d6da6898a
commit
1bac3abc07
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164152
@ -569,6 +569,8 @@ fetch(char *URL, const char *path)
|
||||
if (tmppath != NULL) {
|
||||
mkstemps(tmppath, strlen(slash) + 1);
|
||||
of = fopen(tmppath, "w");
|
||||
chown(tmppath, sb.st_uid, sb.st_gid);
|
||||
chmod(tmppath, sb.st_mode & ALLPERMS);
|
||||
}
|
||||
}
|
||||
if (of == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user