aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Lepied <flepied@mandriva.com>2005-08-17 06:51:58 +0000
committerFrederic Lepied <flepied@mandriva.com>2005-08-17 06:51:58 +0000
commitc31234c4fc552711891aadeb61f12df37ffb20ad (patch)
treefd1354f0930dfc4d9543c38b0a1607de706ec4e9
parentb77564e65e14ba7649e128a840dfb9127b9cb974 (diff)
downloadmsec-c31234c4fc552711891aadeb61f12df37ffb20ad.tar
msec-c31234c4fc552711891aadeb61f12df37ffb20ad.tar.gz
msec-c31234c4fc552711891aadeb61f12df37ffb20ad.tar.bz2
msec-c31234c4fc552711891aadeb61f12df37ffb20ad.tar.xz
msec-c31234c4fc552711891aadeb61f12df37ffb20ad.zip
password_aging: fix for empty max field.
-rw-r--r--share/libmsec.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/share/libmsec.py b/share/libmsec.py
index bbb6ebd..7d0c963 100644
--- a/share/libmsec.py
+++ b/share/libmsec.py
@@ -1225,11 +1225,6 @@ def password_aging(max, inactive=-1):
continue
name = field[0]
password = field[1]
- current_max = int(field[4])
- if field[6] == '':
- current_inactive = -1
- else:
- current_inactive = int(field[6])
if name in no_aging_list:
_interactive and log(_('User %s in password aging exception list') % (name,))
continue
@@ -1239,6 +1234,14 @@ def password_aging(max, inactive=-1):
error(_('User %s in shadow but not in passwd file') % name)
continue
if (len(password) > 0 and password[0] != '!') and password != '*' and password != 'x' and (entry[2] >= uid_min or entry[2] == 0):
+ if field[4] == '':
+ current_max = 99999
+ else:
+ current_max = int(field[4])
+ if field[6] == '':
+ current_inactive = -1
+ else:
+ current_inactive = int(field[6])
new_max = max
new_inactive = inactive
# don't lower security when not changing security level