From 30f27ec7d5ac5ba1dd4c47153b270aa5428067e4 Mon Sep 17 00:00:00 2001 From: joey <> Date: Wed, 27 Oct 2004 12:15:39 +0000 Subject: [PATCH] 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) --- ud-groupadd | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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")); -- 2.20.1