limit create file permissions

Be safe by default, create files so that other users can't read them,
at least until the original permissions are set.
This commit is contained in:
David Fries 2014-10-31 17:28:45 -05:00
parent 678fdd1d42
commit f22b62c1a4
2 changed files with 3 additions and 0 deletions

View File

@ -13,6 +13,7 @@ Version 0.14
- Add MacPorts' path to the default openssl search path (#101)
- HashIndex improvements, eliminates unnecessary IO on low memory systems.
- Fix "Number of files" output for attic info. (#124)
- limit create file permissions so files aren't read while restoring
Version 0.13
------------

View File

@ -186,6 +186,8 @@ Type "Yes I am sure" if you understand this and want to continue.\n""")
def do_extract(self, args):
"""Extract archive contents"""
# be restrictive when restoring files, restore permissions later
os.umask(0o077)
repository = self.open_repository(args.archive)
manifest, key = Manifest.load(repository)
archive = Archive(repository, key, manifest, args.archive.archive,