Import from samosa: The LDAP server in woody doesn't provide an
authorjoey <>
Wed, 27 Oct 2004 12:15:39 +0000 (12:15 +0000)
committerjoey <>
Wed, 27 Oct 2004 12:15:39 +0000 (12:15 +0000)
integer attribute comparision function.

This is broken with Woody LDAP and the Schema; for now just search
through all GIDs.  (James Troup)

ud-groupadd

index 7a6dc16..4cb10ee 100755 (executable)
@@ -10,10 +10,12 @@ from userdir_gpg import *;
 # is to randomly guess uids until one is free. This uses the former.
 # Regrettably ldap doesn't have an integer attribute comparision function
 # so we can only cut the search down slightly
+
+# [JT] This is broken with Woody LDAP and the Schema; for now just
+#      search through all GIDs.
 def GetFreeID(l):
-   HighestUID = 1000;
    Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,
-                      "gidNumber>="+str(HighestUID),["gidNumber"]);
+                      "gidNumber=*",["gidNumber"]);
    HighestUID = 0;
    for I in Attrs:
       ID = int(GetAttr(I,"gidNumber","0"));