From 3810efbdac378c136600a42bbe06e9f5b4117437 Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Fri, 12 Aug 2005 06:07:43 +0000 Subject: allow_user_list: fixed kdmrc settings. support new inittab syntax for single user mode. fix parsing of new chage output (bug #17477). --- share/libmsec.py | 13 ++++++++----- 1 file 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 -- cgit v1.2.1