X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=blobdiff_plain;f=ud-groupadd;h=4cb10eec7b1ea040ac0478f5768101c73506c25f;hp=7a6dc16cd57a368dc745abca29ece453cf7120a3;hb=30f27ec7d5ac5ba1dd4c47153b270aa5428067e4;hpb=50ab9059306495255335965e89423fabd31ac3e6 diff --git a/ud-groupadd b/ud-groupadd index 7a6dc16..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"));