VMM/handler: Create domain directory with umask 0022. v0.6.x
authorPascal Volk <user@localhost.localdomain.org>
Fri, 06 Apr 2012 23:37:04 +0000
branchv0.6.x
changeset 493 30365a87650d
parent 492 e5c2b3647971
child 494 2c5e2613eca8
VMM/handler: Create domain directory with umask 0022.
VirtualMailManager/handler.py
--- a/VirtualMailManager/handler.py	Sat Apr 07 00:45:57 2012 +0200
+++ b/VirtualMailManager/handler.py	Fri Apr 06 23:37:04 2012 +0000
@@ -290,6 +290,7 @@
         hashdir, domdir = domain.directory.split(os.path.sep)[-2:]
         dir_created = False
         os.chdir(self._cfg.dget('misc.base_directory'))
+        old_umask = os.umask(0022)
         if not os.path.exists(hashdir):
             os.mkdir(hashdir, 0711)
             os.chown(hashdir, 0, 0)
@@ -303,6 +304,7 @@
         os.mkdir(os.path.join(hashdir, domdir),
                  self._cfg.dget('domain.directory_mode'))
         os.chown(domain.directory, 0, domain.gid)
+        os.umask(old_umask)
         os.chdir(cwd)
 
     def _make_home(self, account):