Added a hacky sanity check, so we don't create users with iud < 100, ever
authorMichael Biggs <mbiggs@csclub.uwaterloo.ca>
Fri, 18 Feb 2005 17:02:18 +0000 (17:02 +0000)
committerMichael Biggs <mbiggs@csclub.uwaterloo.ca>
Fri, 18 Feb 2005 17:02:18 +0000 (17:02 +0000)
    (even if LDAP screws up getpwent() somehow) <-- this happened!!!! :(

modules/Accounts.pm

index b9b70a7..457dfd1 100644 (file)
@@ -58,6 +58,11 @@ sub Add($) {
                 $maxid = $idnum;
             }
         }
+        if( $maxid < 100 ) {
+            # This is bad.  getpwent() failed miserably.
+            # TODO: Really fix this sometime
+            die 1;
+        }
         $uidnum = $maxid + 1;
 
         open LDAPSECRET, "</etc/ldap.ceo";