From 6e2080a451a070bf34bd6b86071f6014ba584d15 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Thu, 11 Sep 2014 13:52:04 -0500 Subject: [PATCH] Ignore lchmod() ENOSYS (i.e. function not implemented) When restoring symlink permissions, assume that ENOSYS means that it's not possible to lchmod(). For comparison, it looks like tar doesn't handle lchmod() at all yet. From the Debian tar 1.27.1 TODO: * Add support for restoring the attributes of symbolic links, for OSes like FreeBSD that have the lutimes and lchmod functions. Thanks to Xiao LIU for reporting the problem. Signed-off-by: Rob Browning Tested-by: Rob Browning --- lib/bup/metadata.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/bup/metadata.py b/lib/bup/metadata.py index 390c5ac..bef8066 100644 --- a/lib/bup/metadata.py +++ b/lib/bup/metadata.py @@ -423,7 +423,10 @@ class Metadata: raise if _have_lchmod: - os.lchmod(path, stat.S_IMODE(self.mode)) + try: + os.lchmod(path, stat.S_IMODE(self.mode)) + except errno.ENOSYS: # Function not implemented + pass elif not stat.S_ISLNK(self.mode): os.chmod(path, stat.S_IMODE(self.mode)) -- 2.39.2