Greetings, If I used webmin to add a user, the next time msec runs it complains:
msec: unable to parse chage output I took a look at why this happens and found a fix, which is shown below. This fix has already made it into cooker. Any chance of an 8.2 update? Thanks. David ************************************************************* When webmin adds a user, the entry in /etc/shadow looks like: usr1:$3$37105428$38J/slmiH0OJ6iRnZKZp9.:11772:::::: /usr/share/msec/libmsec.py expects to have a number as the maximum field, as in: usr2:$3$37105428$38J/slmiH0OJ6iRnZKZp9.:11772::99999:::: Here's the output from chage for these two users: [root@osage samba]# /usr/bin/chage -l usr1 Minimum: -1 Maximum: -1 Warning: -1 Inactive: -1 Last Change: Mar 26, 2002 Password Expires: Never Password Inactive: Never Account Expires: Never [root@osage samba]# /usr/bin/chage -l usr2 Minimum: -1 Maximum: 99999 Warning: -1 Inactive: -1 Last Change: Mar 26, 2002 Password Expires: Never Password Inactive: Never Account Expires: Never The line "Maximum:...99999" is recognized by object maximum_regex. Adding a regular expression to recognize "Maximum:...-1" allows libmsec.py to successfully process the lines in /etc/shadow generated by webmin. I've made this change to my copy of libmsec.py and msec is happy. Here's the patch: [root@osage msec]# diff -u libmsec.py.orig libmsec.py --- libmsec.py.orig Fri Mar 8 13:41:21 2002 +++ libmsec.py Mon Mar 25 23:35:08 2002 @@ -544,6 +544,7 @@ atallow.replace_line_matching('root', 'root', 1) maximum_regex = re.compile('^Maximum:\s*([0-9]+)', re.MULTILINE) +minimum_regex = re.compile('^Maximum:\s*(-1)', re.MULTILINE) inactive_regex = re.compile('^Inactive:\s*(-?[0-9]+)', re.MULTILINE) # TODO FL Sat Dec 29 20:18:20 2001 @@ -577,7 +578,7 @@ ret = commands.getstatusoutput(cmd) _interactive and log(_('got current maximum password aging for user %s with command \'%s\'') % (entry[0], cmd)) if ret[0] == 0: - res = maximum_regex.search(ret[1]) + res = maximum_regex.search(ret[1]) or minimum_regex.search(ret[1]) res2 = inactive_regex.search(ret[1]) if res and res2: current_max = int(res.group(1))
Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com