mirror of
https://github.com/borgbackup/borg.git
synced 2026-05-28 04:03:21 -04:00
Various bug fixes
This commit is contained in:
parent
9e35c56adb
commit
bee4c86719
3 changed files with 5 additions and 4 deletions
|
|
@ -14,7 +14,7 @@ from .helpers import uid2user, user2uid, gid2group, group2gid, IntegrityError
|
|||
CHUNK_SIZE = 55001
|
||||
|
||||
have_lchmod = hasattr(os, 'lchmod')
|
||||
linux = sys.platform == 'linux'
|
||||
linux = sys.platform == 'linux2'
|
||||
|
||||
|
||||
class Archive(object):
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class Archiver(object):
|
|||
cache = Cache(store, keychain)
|
||||
for path in args.paths:
|
||||
for path, st in walk_dir(unicode(path)):
|
||||
self.print_verbose(path)
|
||||
if stat.S_ISDIR(st.st_mode):
|
||||
archive.process_dir(path, st)
|
||||
elif stat.S_ISLNK(st.st_mode):
|
||||
|
|
|
|||
|
|
@ -37,12 +37,12 @@ class Keychain(object):
|
|||
raise ValueError('Not a keychain')
|
||||
cdata = fd.read()
|
||||
self.password = ''
|
||||
data = self._decrypt(cdata, '')
|
||||
data = self.decrypt_keychain(cdata, '')
|
||||
while not data:
|
||||
self.password = getpass('Keychain password: ')
|
||||
if not self.password:
|
||||
raise Exception('Keychain decryption failed')
|
||||
data = self.decrypt(cdata, self.password)
|
||||
data = self.decrypt_keychain(cdata, self.password)
|
||||
if not data:
|
||||
print 'Incorrect password'
|
||||
chain = msgpack.unpackb(data)
|
||||
|
|
@ -71,7 +71,7 @@ class Keychain(object):
|
|||
}
|
||||
return msgpack.packb(d)
|
||||
|
||||
def _decrypt(self, data, password):
|
||||
def decrypt_keychain(self, data, password):
|
||||
d = msgpack.unpackb(data)
|
||||
assert d['version'] == 1
|
||||
assert d['algorithm'] == 'SHA256'
|
||||
|
|
|
|||
Loading…
Reference in a new issue