mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-13 05:28:49 +00:00
parent
c30de8add4
commit
f086bc9564
1 changed files with 8 additions and 0 deletions
|
@ -847,6 +847,14 @@ bool env_universal_t::sync(callback_data_list_t *callbacks)
|
|||
|
||||
if (success)
|
||||
{
|
||||
/* Ensure we maintain ownership and permissions (#2176) */
|
||||
struct stat sbuf;
|
||||
if (wstat(vars_path, &sbuf) >= 0)
|
||||
{
|
||||
fchown(private_fd, sbuf.st_uid, sbuf.st_gid);
|
||||
fchmod(private_fd, sbuf.st_mode);
|
||||
}
|
||||
|
||||
/* Apply new file */
|
||||
success = this->move_new_vars_file_into_place(private_file_path, vars_path);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue