aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2002-01-29 05:22:32 +0000
committerFrederic Lepied <flepied@mandriva.com>2002-01-29 05:22:32 +0000
commita08f7a61dcece90c46f63002f681a788d02596fd (patch)
tree5c3fed8b1c66d623c9dbb396a6afa95797e969c6
parentd12f477c69caa7c6b19239749c12566959d21be8 (diff)
downloadmsec-a08f7a61dcece90c46f63002f681a788d02596fd.tar
msec-a08f7a61dcece90c46f63002f681a788d02596fd.tar.gz
msec-a08f7a61dcece90c46f63002f681a788d02596fd.tar.bz2
msec-a08f7a61dcece90c46f63002f681a788d02596fd.tar.xz
msec-a08f7a61dcece90c46f63002f681a788d02596fd.zip
password aging for root too.
-rw-r--r--share/libmsec.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/libmsec.py b/share/libmsec.py
index 5c939e9..1953e9c 100644
--- a/share/libmsec.py
+++ b/share/libmsec.py
@@ -486,7 +486,7 @@ def password_aging(max):
uid_min = int(uid_min)
shadow = ConfigFile.get_config_file(SHADOW)
if shadow.exists():
- _interactive and log(_('Setting password maximum aging for users with id greater than %d to %d') % (uid_min, max))
+ _interactive and log(_('Setting password maximum aging for root and users with id greater than %d to %d') % (uid_min, max))
for line in shadow.get_lines():
field = string.split(line, ':')
if len(field) < 2:
@@ -494,7 +494,7 @@ def password_aging(max):
name = field[0]
password = field[1]
entry = pwd.getpwnam(name)
- if (len(password) > 0 and password[0] != '!') and password != '*' and password != 'x' and entry[2] >= uid_min:
+ if (len(password) > 0 and password[0] != '!') and password != '*' and password != 'x' and (entry[2] >= uid_min or entry[2] == 0):
cmd = '/usr/bin/chage -l %s' % entry[0]
ret = commands.getstatusoutput(cmd)
_interactive and log(_('got current maximum password aging for user %s with command \'%s\'') % (entry[0], cmd))