usr/src/cmd/installadm/image.py
changeset 1676 1ced705a7c09
parent 1675 c225c357f3d2
child 1733 880745153109
--- a/usr/src/cmd/installadm/image.py	Tue May 15 13:06:18 2012 -0700
+++ b/usr/src/cmd/installadm/image.py	Wed May 16 16:31:20 2012 +0200
@@ -158,7 +158,12 @@
         '''
         self._remove_ai_webserver_symlink()
         try:
+            # This directory need to have at least o+x permission.
+            orig_umask = os.umask(00)
+            modified_umask = orig_umask & 0776
+            os.umask(modified_umask)
             os.makedirs(os.path.dirname(new_path))
+            os.umask(orig_umask)
         except OSError as err:
             if err.errno != errno.EEXIST:
                 raise
@@ -236,7 +241,12 @@
         '''Enable the AI webserver to access the image path'''
         target_path = os.path.dirname(self.path).lstrip("/")
         try:
+            # This directory need to have at least o+x permission.
+            orig_umask = os.umask(00)
+            modified_umask = orig_umask & 0776
+            os.umask(modified_umask)
             os.makedirs(os.path.join(com.WEBSERVER_DOCROOT, target_path))
+            os.umask(orig_umask)
         except OSError as err:
             if err.errno != errno.EEXIST:
                 raise