mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-23 14:41:43 +00:00
xattrs cleanup, #6908
https://github.com/borgbackup/borg/issues/6908#issuecomment-1224870018
This commit is contained in:
parent
287907b218
commit
6a1c64b0dc
1 changed files with 3 additions and 4 deletions
|
@ -947,10 +947,10 @@ def restore_attrs(self, path, item, symlink=False, fd=None):
|
|||
pass
|
||||
if not self.noacls:
|
||||
acl_set(path, item, self.numeric_ids, fd=fd)
|
||||
if not self.noxattrs:
|
||||
if not self.noxattrs and "xattrs" in item:
|
||||
# chown removes Linux capabilities, so set the extended attributes at the end, after chown, since they include
|
||||
# the Linux capabilities in the "security.capability" attribute.
|
||||
warning = xattr.set_all(fd or path, item.get("xattrs", {}), follow_symlinks=False)
|
||||
warning = xattr.set_all(fd or path, item.xattrs, follow_symlinks=False)
|
||||
if warning:
|
||||
set_ec(EXIT_WARNING)
|
||||
# bsdflags include the immutable flag and need to be set last:
|
||||
|
@ -1148,8 +1148,7 @@ def stat_ext_attrs(self, st, path, fd=None):
|
|||
if not self.noxattrs:
|
||||
with backup_io("extended stat (xattrs)"):
|
||||
xattrs = xattr.get_all(fd or path, follow_symlinks=False)
|
||||
if xattrs:
|
||||
attrs["xattrs"] = StableDict(xattrs)
|
||||
attrs["xattrs"] = StableDict(xattrs)
|
||||
if not self.noacls:
|
||||
with backup_io("extended stat (ACLs)"):
|
||||
acl_get(path, attrs, st, self.numeric_ids, fd=fd)
|
||||
|
|
Loading…
Reference in a new issue