Various bug fixes

This commit is contained in:
Jonas Borgström 2010-11-02 18:33:53 +01:00
parent 9e35c56adb
commit bee4c86719
3 changed files with 5 additions and 4 deletions

View file

@ -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):

View file

@ -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):

View file

@ -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'