aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2005-08-12 06:07:43 +0000
committerFrederic Lepied <flepied@mandriva.com>2005-08-12 06:07:43 +0000
commit3810efbdac378c136600a42bbe06e9f5b4117437 (patch)
tree5deab5b1c391549585f091031677a588fa9c457c
parent4e27185aceecea6bb0786fbe4eac9a00da9d58d7 (diff)
downloadmsec-3810efbdac378c136600a42bbe06e9f5b4117437.tar
msec-3810efbdac378c136600a42bbe06e9f5b4117437.tar.gz
msec-3810efbdac378c136600a42bbe06e9f5b4117437.tar.bz2
msec-3810efbdac378c136600a42bbe06e9f5b4117437.tar.xz
msec-3810efbdac378c136600a42bbe06e9f5b4117437.zip
allow_user_list: fixed kdmrc settings.
support new inittab syntax for single user mode. fix parsing of new chage output (bug #17477).
-rw-r--r--share/libmsec.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/share/libmsec.py b/share/libmsec.py
index 0d7cefa..2486089 100644
--- a/share/libmsec.py
+++ b/share/libmsec.py
@@ -437,7 +437,7 @@ def allow_reboot(arg):
allow_reboot.arg_trans = YES_NO_TRANS
################################################################################
-SHOW_USERS_VALUES = ('NotHidden', 'Selected', 'None')
+SHOW_USERS_VALUES = ('All', 'Selected', 'None')
def allow_user_list(arg):
''' Allow/Forbid the list of users on the system on display managers (kdm and gdm).'''
@@ -1135,7 +1135,7 @@ def enable_sulogin(arg):
else:
if val:
_interactive and log(_('Disabling sulogin in single user runlevel'))
- inittab.replace_line_matching('[^#]+:S:', '~~:S:wait:/bin/sh', 1)
+ inittab.remove_line_matching('~~:S:wait:/sbin/sulogin')
enable_sulogin.arg_trans = YES_NO_TRANS
@@ -1196,8 +1196,8 @@ enable_at_crontab.arg_trans = YES_NO_TRANS
################################################################################
-maximum_regex = re.compile('^Maximum:\s*([0-9]+|-1)', re.MULTILINE)
-inactive_regex = re.compile('^Inactive:\s*(-?[0-9]+)', re.MULTILINE)
+maximum_regex = re.compile('^Maximum.*:\s*([0-9]+|-1)', re.MULTILINE)
+inactive_regex = re.compile('^(Inactive|Password inactive\s*):\s*(-?[0-9]+|never)', re.MULTILINE)
no_aging_list = []
def no_password_aging_for(name):
@@ -1244,7 +1244,10 @@ def password_aging(max, inactive=-1):
res2 = inactive_regex.search(ret[1])
if res and res2:
current_max = int(res.group(1))
- current_inactive = int(res2.group(1))
+ if res2.group(2) == 'never':
+ current_inactive = 99999
+ else:
+ current_inactive = int(res2.group(2))
new_max = max
new_inactive = inactive
# don't lower security when not changing security level