"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "Tardis/Regenerate.py" between
Tardis-1.0.4.tar.gz and Tardis-1.0.5.tar.gz

About: Tardis is a system for making encrypted, incremental backups of filesystems.

Regenerate.py  (Tardis-1.0.4):Regenerate.py  (Tardis-1.0.5)
skipping to change at line 250 skipping to change at line 250
logger.error("Unable to read file: {}: {}".format(i, repr(e))) logger.error("Unable to read file: {}: {}".format(i, repr(e)))
raise raise
finally: finally:
i.close() i.close()
if output is not sys.stdout: if output is not sys.stdout:
output.close() output.close()
if authenticate: if authenticate:
outname = doAuthenticate(outname, checksum, hasher.h exdigest()) outname = doAuthenticate(outname, checksum, hasher.h exdigest())
if outname and args.setperm: if outname and not skip:
try: if args.setperm:
logger.debug("Setting permissions on %s to %o", outname, inf try:
o['mode']) logger.debug("Setting permissions on %s to %o", outname,
os.chmod(outname, info['mode']) info['mode'])
except Exception as e: os.chmod(outname, info['mode'])
logger.warning("Unable to set permissions for %s", outname) except Exception as e:
try: logger.warning("Unable to set permissions for %s", outna
# Change the group, then the owner. me)
# Change the group first, as only root can change owner, and try:
that might fail. # Change the group, then the owner.
os.chown(outname, -1, info['gid']) # Change the group first, as only root can change owner,
os.chown(outname, info['uid'], -1) and that might fail.
except Exception as e: os.chown(outname, -1, info['gid'])
logger.warning("Unable to set owner and group of %s", outnam os.chown(outname, info['uid'], -1)
e) except Exception as e:
if outname and args.setattrs and 'attr' in info and info['attr']: logger.warning("Unable to set owner and group of %s", ou
try: tname)
f = regenerator.recoverChecksum(info['attr'], authenticate) if args.settime:
xattrs = json.loads(f.read()) try:
x = xattr.xattr(outname) logger.debug("Setting times on %s to %d %d", outname, in
for attr in xattrs.keys(): fo['atime'], info['mtime'])
value = base64.b64decode(xattrs[attr]) os.utime(outname, (info['atime'], info['mtime']))
try: except Exception as e:
x.set(attr, value) logger.warning("Unable to set times on %s", outname)
except IOError:
logger.warning("Unable to set extended attribute %s if args.setattrs and 'attr' in info and info['attr']:
on %s", attr, outname) try:
except Exception as e: f = regenerator.recoverChecksum(info['attr'], authentica
logger.warning("Unable to process extended attributes for %s te)
", outname) xattrs = json.loads(f.read())
if outname and args.setacl and 'acl' in info and info['acl']: x = xattr.xattr(outname)
try: for attr in xattrs.keys():
f = regenerator.recoverChecksum(info['acl'], authenticate) value = base64.b64decode(xattrs[attr])
acl = json.loads(f.read()) try:
a = posix1e.ACL(text=acl) x.set(attr, value)
a.applyto(outname) except IOError:
except Exception as e: logger.warning("Unable to set extended attribute
logger.warning("Unable to process extended attributes for %s %s on %s", attr, outname)
", outname) except Exception as e:
logger.warning("Unable to process extended attributes fo
r %s", outname)
if args.setacl and 'acl' in info and info['acl']:
try:
f = regenerator.recoverChecksum(info['acl'], authenticat
e)
acl = json.loads(f.read())
a = posix1e.ACL(text=acl)
a.applyto(outname)
except Exception as e:
logger.warning("Unable to process extended attributes fo
r %s", outname)
except Exception as e: except Exception as e:
logger.error("Recovery of %s failed. %s", outname, e) logger.error("Recovery of %s failed. %s", outname, e)
exceptionLogger.log(e) exceptionLogger.log(e)
retCode += 1 retCode += 1
return retCode return retCode
def setupPermissionChecks(): def setupPermissionChecks():
uid = os.getuid() uid = os.getuid()
groups = os.getgroups() groups = os.getgroups()
 End of changes. 1 change blocks. 
40 lines changed or deleted 52 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)