1.1 --- a/imiptools/config.py Thu Feb 12 16:39:06 2015 +0100
1.2 +++ b/imiptools/config.py Thu Feb 12 17:01:55 2015 +0100
1.3 @@ -27,6 +27,11 @@
1.4
1.5 DEFAULT_PERMISSIONS = 0660
1.6
1.7 +# Permissions for directories.
1.8 +# This is meant to ensure that the group is set for files.
1.9 +
1.10 +DEFAULT_DIR_PERMISSIONS = 02660
1.11 +
1.12 # The published location of the manager application.
1.13 # This must match any Web site configuration details for the manager.
1.14
2.1 --- a/imiptools/filesys.py Thu Feb 12 16:39:06 2015 +0100
2.2 +++ b/imiptools/filesys.py Thu Feb 12 17:01:55 2015 +0100
2.3 @@ -20,7 +20,7 @@
2.4 """
2.5
2.6 import errno
2.7 -from imiptools.config import DEFAULT_PERMISSIONS
2.8 +from imiptools.config import DEFAULT_PERMISSIONS, DEFAULT_DIR_PERMISSIONS
2.9 from os.path import abspath, commonprefix, exists, join
2.10 from os import chmod, makedirs, mkdir, rmdir
2.11 from time import sleep, time
2.12 @@ -28,9 +28,9 @@
2.13 def check_dir(base, dir):
2.14 return commonprefix([base, abspath(dir)]) == base
2.15
2.16 -def fix_permissions(filename):
2.17 +def fix_permissions(filename, is_dir=False):
2.18 try:
2.19 - chmod(filename, DEFAULT_PERMISSIONS)
2.20 + chmod(filename, is_dir and DEFAULT_DIR_PERMISSIONS or DEFAULT_PERMISSIONS)
2.21 except OSError:
2.22 pass
2.23