aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-05-29 20:35:45 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-05-29 20:35:45 +0000
commit88c4c77b8ef59022df4a22fb13a4519520f18175 (patch)
tree42b924b806c486d7078acb57bd62febc20907645
parent7347eaada7c393d62dd9b5ae55f6288de5da1543 (diff)
downloadmsec-88c4c77b8ef59022df4a22fb13a4519520f18175.tar
msec-88c4c77b8ef59022df4a22fb13a4519520f18175.tar.gz
msec-88c4c77b8ef59022df4a22fb13a4519520f18175.tar.bz2
msec-88c4c77b8ef59022df4a22fb13a4519520f18175.tar.xz
msec-88c4c77b8ef59022df4a22fb13a4519520f18175.zip
added no_password_aging_for
-rw-r--r--share/libmsec.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/share/libmsec.py b/share/libmsec.py
index 2827ca3..d3fad9f 100644
--- a/share/libmsec.py
+++ b/share/libmsec.py
@@ -543,11 +543,16 @@ def enable_at_crontab(arg):
maximum_regex = re.compile('^Maximum:\s*([0-9]+|-1)', re.MULTILINE)
inactive_regex = re.compile('^Inactive:\s*(-?[0-9]+)', re.MULTILINE)
+no_aging_list = []
+def no_password_aging_for(name):
+ '''D Add the name as an exception to the handling of password aging by msec.'''
+ no_aging_list.append(name)
+
# TODO FL Sat Dec 29 20:18:20 2001
# replace chage calls and /etc/shadow parsing by a python API to the shadow functions.
def password_aging(max, inactive=-1):
- ''' Set password aging to \\fImax\\fP days and delay to change to \\fIinactive\\fP.'''
+ ''' Set password aging to \\fImax\\fP days and delay to change to \\fIinactive\\fP.'''
uid_min = 500
_interactive and log(_('Setting password maximum aging for new user to %d') % max)
logindefs = ConfigFile.get_config_file(LOGINDEFS)
@@ -565,6 +570,9 @@ def password_aging(max, inactive=-1):
continue
name = field[0]
password = field[1]
+ if name in no_aging_list:
+ _interactive and log(_('User %s in password aging exception list') % (name,)
+ continue
try:
entry = pwd.getpwnam(name)
except KeyError: