Here's the patch that allows msec to accept "-1" as the password's age.  It 
was generated out of the discovery that webmin creates new user ids with -1 
as their password age.  Recent traffic indicates that there may be other 
ways to cause chage to complain about a -1 age (and hence cause msec to be 
unhappy).

[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))
--------------------------------------------------------
David Relson                   Osage Software Systems, Inc.
[EMAIL PROTECTED]       Ann Arbor, MI 48103
www.osagesoftware.com          tel:  734.821.8800


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com

Reply via email to