mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-21 21:57:36 +00:00
require and use chown with follow_symlinks=False
should be equivalent to using os.lchown() before.
This commit is contained in:
parent
b484c79bc2
commit
094376a8ad
2 changed files with 2 additions and 2 deletions
|
@ -674,7 +674,7 @@ def restore_attrs(self, path, item, symlink=False, fd=None):
|
||||||
if fd:
|
if fd:
|
||||||
os.fchown(fd, uid, gid)
|
os.fchown(fd, uid, gid)
|
||||||
else:
|
else:
|
||||||
os.lchown(path, uid, gid)
|
os.chown(path, uid, gid, follow_symlinks=False)
|
||||||
except OSError:
|
except OSError:
|
||||||
pass
|
pass
|
||||||
if fd:
|
if fd:
|
||||||
|
|
|
@ -119,7 +119,7 @@ class PythonLibcTooOld(Error):
|
||||||
|
|
||||||
|
|
||||||
def check_python():
|
def check_python():
|
||||||
required_funcs = {os.stat, os.utime}
|
required_funcs = {os.stat, os.utime, os.chown}
|
||||||
if not os.supports_follow_symlinks.issuperset(required_funcs):
|
if not os.supports_follow_symlinks.issuperset(required_funcs):
|
||||||
raise PythonLibcTooOld
|
raise PythonLibcTooOld
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue