mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #43863 from nicholasmhughes/fix-atomicfile-permission-copy
Atomicfile only copies mode and not user/group perms
This commit is contained in:
commit
ed8da2450b
@ -120,6 +120,8 @@ class _AtomicWFile(object):
|
||||
self._fh.close()
|
||||
if os.path.isfile(self._filename):
|
||||
shutil.copymode(self._filename, self._tmp_filename)
|
||||
st = os.stat(self._filename)
|
||||
os.chown(self._tmp_filename, st.st_uid, st.st_gid)
|
||||
atomic_rename(self._tmp_filename, self._filename)
|
||||
|
||||
def __exit__(self, exc_type, exc_value, traceback):
|
||||
|
Loading…
Reference in New Issue
Block a user