aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEugeni Dodonov <eugeni@mandriva.org>2009-04-22 19:01:27 +0000
committerEugeni Dodonov <eugeni@mandriva.org>2009-04-22 19:01:27 +0000
commit522e3fac289dd99dc90753192256573992ba3217 (patch)
tree0f1a87af981945a0754b7d59adeec163c638b762 /src
parent50610bcb6fb8caf985d2a83c1a036ff08e10a4ce (diff)
downloadmsec-522e3fac289dd99dc90753192256573992ba3217.tar
msec-522e3fac289dd99dc90753192256573992ba3217.tar.gz
msec-522e3fac289dd99dc90753192256573992ba3217.tar.bz2
msec-522e3fac289dd99dc90753192256573992ba3217.tar.xz
msec-522e3fac289dd99dc90753192256573992ba3217.zip
Properly handle WIN_PARTS_UMASK.
Diffstat (limited to 'src')
-rw-r--r--src/msec/config.py1
-rwxr-xr-xsrc/msec/libmsec.py11
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)