mirror of
https://github.com/opnsense/src.git
synced 2026-06-09 08:43:19 -04: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
1 changed files with 2 additions and 0 deletions
|
|
@ -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 a new issue