mirror of
https://github.com/borgbackup/borg.git
synced 2025-02-21 21:57:36 +00:00
Merge pull request #3266 from ThomasWaldmann/set-bsdflags-last
set bsdflags last (include immutable flag), fixes #3263
This commit is contained in:
commit
41ccd3d7d1
1 changed files with 6 additions and 6 deletions
|
@ -702,12 +702,6 @@ def restore_attrs(self, path, item, symlink=False, fd=None):
|
|||
# some systems don't support calling utime on a symlink
|
||||
pass
|
||||
acl_set(path, item, self.numeric_owner)
|
||||
|
||||
if not self.nobsdflags and 'bsdflags' in item:
|
||||
try:
|
||||
set_flags(path, item.bsdflags, fd=fd)
|
||||
except OSError:
|
||||
pass
|
||||
# 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.
|
||||
xattrs = item.get('xattrs', {})
|
||||
|
@ -730,6 +724,12 @@ def restore_attrs(self, path, item, symlink=False, fd=None):
|
|||
set_ec(EXIT_WARNING)
|
||||
else:
|
||||
raise
|
||||
# bsdflags include the immutable flag and need to be set last:
|
||||
if not self.nobsdflags and 'bsdflags' in item:
|
||||
try:
|
||||
set_flags(path, item.bsdflags, fd=fd)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def set_meta(self, key, value):
|
||||
metadata = self._load_meta(self.id)
|
||||
|
|
Loading…
Reference in a new issue