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
@ -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