X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-groupadd;h=4cb10eec7b1ea040ac0478f5768101c73506c25f;hb=30f27ec7d5ac5ba1dd4c47153b270aa5428067e4;hp=07f0e9b6a31ecfdcba95c3a3f46cc539fc27d7e0;hpb=6597a93ddb54485b12420100c45dc83a42f70d8a;p=mirror%2Fuserdir-ldap.git diff --git a/ud-groupadd b/ud-groupadd index 07f0e9b..4cb10ee 100755 --- a/ud-groupadd +++ b/ud-groupadd @@ -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")); @@ -60,5 +62,4 @@ print "Updating LDAP directory..", sys.stdout.flush(); l.add_s(Dn,[("gid",Group), ("gidNumber",str(Id)), - ("objectclass","top"), - ("objectclass","posixGroup")]); + ("objectClass",("top", "debianGroup"))]);