From a9c85513b0617ec3a00ad58352e5c74df2a13faf Mon Sep 17 00:00:00 2001 From: Anders Blomdell <anders.blomdell@control.lth.se> Date: Wed, 9 Nov 2016 12:58:13 +0100 Subject: [PATCH] Allow uid/gid changing for symlinks and sockets --- secondary.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/secondary.py b/secondary.py index 936e311..c308633 100644 --- a/secondary.py +++ b/secondary.py @@ -75,13 +75,13 @@ class Backup: self.status.replaced += 1 self.delete(dst) self.add(src) - elif os.path.exists(dst_path): + elif os.path.lexists(dst_path): changed = False if src.kind in [ b'F', b'D'] and src.mode != dst.mode: self.log.DEBUG('MODE', dst.name, src.mode, dst.mode) os.chmod(dst_path, int(src.mode, 8)) changed = True - if (src.kind in [ b'F', b'D'] and + if (src.kind in [ b'F', b'D', b'L', b'S'] and (src.uid != dst.uid or src.gid != dst.gid)): self.log.DEBUG('UID/GID', dst.name, src.uid, src.gid, dst.uid, dst.gid) -- GitLab