Merge fixes

This commit is contained in:
Marian Beermann
2016-07-17 19:10:50 +02:00
parent b48cde9f50
commit cd17602069
3 changed files with 7 additions and 7 deletions
+3 -3
View File
@@ -432,12 +432,12 @@ Number of files: {0.stats.nfiles}'''.format(
sys.stdout.buffer.flush()
if has_damaged_chunks:
logger.warning('File %s has damaged (all-zero) chunks. Try running borg check --repair.' %
remove_surrogates(item[b'path']))
remove_surrogates(item.path))
return
original_path = original_path or item.path
dest = self.cwd
if item[b'path'].startswith('/') or item[b'path'].startswith('..') or (sys.platform == 'win32' and len(item[b'path']) > 1 and item[b'path'][1] == ':'):
if item.path.startswith('/') or item.path.startswith('..') or (sys.platform == 'win32' and len(item.path) > 1 and item.path[1] == ':'):
raise Exception('Path should be relative and local')
path = os.path.join(dest, item.path)
# Attempt to remove existing files, ignore errors on failure
@@ -552,7 +552,7 @@ Number of files: {0.stats.nfiles}'''.format(
pass
else:
try:
set_owner(path, item[b'user'], safe_decode(item[b'uid']))
set_owner(path, item.user, safe_decode(item.uid))
except OSError:
pass
if sys.platform != 'win32':
+2 -2
View File
@@ -452,7 +452,7 @@ class Archiver:
try:
archive.extract_item(dir_item, stdout=stdout)
except BackupOSError as e:
self.print_warning('%s: %s', remove_surrogates(dir_item[b'path']), e)
self.print_warning('%s: %s', remove_surrogates(dir_item.path), e)
if output_list:
logging.getLogger('borg.output.list').info(remove_surrogates(orig_path))
try:
@@ -474,7 +474,7 @@ class Archiver:
try:
archive.extract_item(dir_item)
except BackupOSError as e:
self.print_warning('%s: %s', remove_surrogates(dir_item[b'path']), e)
self.print_warning('%s: %s', remove_surrogates(dir_item.path), e)
for pattern in include_patterns:
if pattern.match_count == 0:
self.print_warning("Include pattern '%s' never matched.", pattern)
+2 -2
View File
@@ -300,7 +300,7 @@ def acl_get(path, item, st, numeric_owner=False):
continue
permissions = {'user': {'name': name, 'sid': sidstr}, 'permissions': (ACEs[i].grfAccessPermissions, ACEs[i].grfAccessMode, ACEs[i].grfInheritance)}
pyDACL.append(permissions)
item[b'win_dacl'] = safe_encode(json.dumps(pyDACL))
item.win_dacl = safe_encode(json.dumps(pyDACL))
free(SD)
LocalFree(<HLOCAL>ACEs)
@@ -310,7 +310,7 @@ def acl_set(path, item, numeric_owner=False):
if b'win_dacl' not in item:
return
pyDACL = json.loads(safe_decode(item[b'win_dacl']))
pyDACL = json.loads(safe_decode(item.win_dacl))
cdef _EXPLICIT_ACCESS_W* ACEs = <_EXPLICIT_ACCESS_W*>calloc(sizeof(_EXPLICIT_ACCESS_W), len(pyDACL))
cdef wchar_t* temp
cdef PSID newsid