# 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"));
l.simple_bind_s(UserDn,Password);
while 1:
- Group = raw_input("Group name?");
+ Group = raw_input("Group name? ");
if Group == "":
sys.exit(1);
sys.stdout.flush();
l.add_s(Dn,[("gid",Group),
("gidNumber",str(Id)),
- ("objectclass","top"),
- ("objectclass","posixGroup")]);
+ ("objectClass",("top", "debianGroup"))]);