From: joey <> Date: Wed, 27 Oct 2004 12:15:39 +0000 (+0000) Subject: Import from samosa: The LDAP server in woody doesn't provide an X-Git-Tag: debian_userdir-ldap_0-3-7~42 X-Git-Url: https://git.adam-barratt.org.uk/?p=mirror%2Fuserdir-ldap.git;a=commitdiff_plain;h=30f27ec7d5ac5ba1dd4c47153b270aa5428067e4 Import from samosa: The LDAP server in woody doesn't provide an integer attribute comparision function. This is broken with Woody LDAP and the Schema; for now just search through all GIDs. (James Troup) --- 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"));