diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/msec/config.py | 1 | ||||
-rwxr-xr-x | src/msec/libmsec.py | 11 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/msec/config.py b/src/msec/config.py index 59aabd5..12188bf 100644 --- a/src/msec/config.py +++ b/src/msec/config.py @@ -115,6 +115,7 @@ SETTINGS_SYSTEM = ["ENABLE_STARTUP_MSEC", "ENABLE_STARTUP_PERMS", "ENABLE_MSEC_C "ALLOW_ROOT_LOGIN", "ALLOW_USER_LIST", "ALLOW_AUTOLOGIN", "ENABLE_CONSOLE_LOG", "CREATE_SERVER_LINK", "ALLOW_XAUTH_FROM_ROOT", "ALLOW_REBOOT", "SHELL_HISTORY_SIZE", "SHELL_TIMEOUT", "USER_UMASK", "ROOT_UMASK", + "WIN_PARTS_UMASK" ] # network security settings SETTINGS_NETWORK = ["ACCEPT_BOGUS_ERROR_RESPONSES", "ACCEPT_BROADCASTED_ICMP_ECHO", "ACCEPT_ICMP_ECHO", diff --git a/src/msec/libmsec.py b/src/msec/libmsec.py index e442a0e..9cd384a 100755 --- a/src/msec/libmsec.py +++ b/src/msec/libmsec.py @@ -973,10 +973,15 @@ class MSEC: def set_win_parts_umask(self, umask): ''' Set umask option for mounting vfat and ntfs partitions. If umask is '0', default system umask is used.''' fstab = self.configfiles.get_config_file(FSTAB) + try: + test_umask = int(umask) + except: + self.log.error(_('Invalid file system umask "%s"') % umask) + return if umask == "0": - fstab.replace_line_matching("(.*\s(vfat|ntfs)\s+)umask=\d+(\s.*)", "@1defaults@3", 0, 1) - fstab.replace_line_matching("(.*\s(vfat|ntfs)\s+)umask=\d+,(.*)", "@1@3", 0, 1) - fstab.replace_line_matching("(.*\s(vfat|ntfs)\s+\S+),umask=\d+(.*)", "@1@3", 0, 1) + fstab.replace_line_matching("(.*\s(vfat|ntfs|ntfs-3g)\s+)umask=\d+(\s.*)", "@1defaults@3", 0, 1) + fstab.replace_line_matching("(.*\s(vfat|ntfs|ntfs-3g)\s+)umask=\d+,(.*)", "@1@3", 0, 1) + fstab.replace_line_matching("(.*\s(vfat|ntfs|ntfs-3g)\s+\S+),umask=\d+(.*)", "@1@3", 0, 1) else: fstab.replace_line_matching("(.*\s(vfat|ntfs|ntfs-3g)\s+\S*)umask=\d+(.*)", "@1umask="+umask+"@3", 0, 1) fstab.replace_line_matching("(.*\s(vfat|ntfs|ntfs-3g)\s+)(?!.*umask=)(\S+)(.*)", "@1@3,umask="+umask+"@4", 0, 1) |