# HG changeset patch
# User Pascal Volk <user@localhost.localdomain.org>
# Date 1333755424 0
# Node ID 30365a87650d3faa821120375dcc92fb5f89260f
# Parent  e5c2b3647971287139093df8722f5a38d7128fcd
VMM/handler: Create domain directory with umask 0022.

diff -r e5c2b3647971 -r 30365a87650d 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):