diff --git a/CHANGES b/CHANGES index 1438135d6..28fed9826 100644 --- a/CHANGES +++ b/CHANGES @@ -3,6 +3,14 @@ Attic Changelog Here you can see the full list of changes between each Attic release. +Version 0.13 +------------ + +(feature release, released on X) + +- Fix bug where xattrs on symlinks were not correctly restored + + Version 0.12 ------------ diff --git a/attic/archive.py b/attic/archive.py index 1fbe97f40..862af7f2b 100644 --- a/attic/archive.py +++ b/attic/archive.py @@ -285,7 +285,7 @@ class Archive: if xattrs: for k, v in xattrs.items(): try: - xattr.setxattr(fd or path, k, v) + xattr.setxattr(fd or path, k, v, follow_symlinks=False) except OSError as e: if e.errno != errno.ENOTSUP: raise diff --git a/attic/testsuite/archiver.py b/attic/testsuite/archiver.py index 3c7aa57ee..415b0e530 100644 --- a/attic/testsuite/archiver.py +++ b/attic/testsuite/archiver.py @@ -128,13 +128,14 @@ class ArchiverTestCase(ArchiverTestCaseBase): os.mknod('input/bdev', 0o600 | stat.S_IFBLK, os.makedev(10, 20)) # Char device os.mknod('input/cdev', 0o600 | stat.S_IFCHR, os.makedev(30, 40)) - if xattr.is_enabled(): - xattr.setxattr(os.path.join(self.input_path, 'file1'), 'user.foo', b'bar') # Hard link os.link(os.path.join(self.input_path, 'file1'), os.path.join(self.input_path, 'hardlink')) # Symlink os.symlink('somewhere', os.path.join(self.input_path, 'link1')) + if xattr.is_enabled(): + xattr.setxattr(os.path.join(self.input_path, 'file1'), 'user.foo', b'bar') + xattr.setxattr(os.path.join(self.input_path, 'link1'), 'user.foo_symlink', b'bar_symlink', follow_symlinks=False) # FIFO node os.mkfifo(os.path.join(self.input_path, 'fifo1'))