Pārlūkot izejas kodu

Merge pull request #126 from dfries/master

limit create file permissions
Jonas Borgström 10 gadi atpakaļ
vecāks
revīzija
ca177aba60
2 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 1 0
      CHANGES
  2. 2 0
      attic/archiver.py

+ 1 - 0
CHANGES

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

+ 2 - 0
attic/archiver.py

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