VirtualMailManager/handler.py
branchv0.6.x
changeset 493 30365a87650d
parent 470 807ad4df0774
child 505 3da8c919584f
--- 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):