Browse Source

require and use chown with follow_symlinks=False

should be equivalent to using os.lchown() before.
Thomas Waldmann 8 years ago
parent
commit
094376a8ad
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/borg/archive.py
  2. 1 1
      src/borg/helpers.py

+ 1 - 1
src/borg/archive.py

@@ -674,7 +674,7 @@ Utilization of max. archive size: {csize_max:.0%}
             if fd:
                 os.fchown(fd, uid, gid)
             else:
-                os.lchown(path, uid, gid)
+                os.chown(path, uid, gid, follow_symlinks=False)
         except OSError:
             pass
         if fd:

+ 1 - 1
src/borg/helpers.py

@@ -119,7 +119,7 @@ class PythonLibcTooOld(Error):
 
 
 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):
         raise PythonLibcTooOld