From 88d8b498b9fa2fe99d86612454eea20533744dc6 Mon Sep 17 00:00:00 2001 From: Neil Williams Date: Sun, 17 Jul 2016 15:38:01 +0100 Subject: Reset umask before creating files --- bin/vmdebootstrap | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/bin/vmdebootstrap b/bin/vmdebootstrap index 63de77b..b958b9d 100755 --- a/bin/vmdebootstrap +++ b/bin/vmdebootstrap @@ -53,6 +53,7 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth self.mount_points = [] self.bootdir = None self.include = [] + self.user_mask = None self.handlers = { Base.name: Base(), Uefi.name: Uefi(), @@ -274,6 +275,7 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth network = self.handlers[Networking.name] distro = self.handlers[Codenames.name] try: + self.user_mask = os.umask(0o022) if self.settings['image']: self._image_preparations() rootdir = filesystem.devices['rootdir'] @@ -528,5 +530,8 @@ class VmDebootstrap(cliapp.Application): # pylint: disable=too-many-public-meth for dirname in self.remove_dirs: shutil.rmtree(dirname) + if self.user_mask: + os.umask(self.user_mask) + if __name__ == '__main__': VmDebootstrap(version=__version__).run() -- cgit v1.2.1