From c31234c4fc552711891aadeb61f12df37ffb20ad Mon Sep 17 00:00:00 2001 From: Frederic Lepied Date: Wed, 17 Aug 2005 06:51:58 +0000 Subject: password_aging: fix for empty max field. --- share/libmsec.py | 13 ++++++++----- 1 file 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 -- cgit v1.2.1