X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-useradd;h=8872507d3657d1a1db071ed3b0190fe43ec36772;hb=16efeb47640693f4404729f08feeadc670ea0203;hp=d6114ba051b27d34dca12b32424f0f7ed24a9fe3;hpb=823ee0d7c48109648bd0f54769bb551ed1aede29;p=mirror%2Fuserdir-ldap.git diff --git a/ud-useradd b/ud-useradd index d6114ba..8872507 100755 --- a/ud-useradd +++ b/ud-useradd @@ -51,7 +51,7 @@ def ShouldIgnoreID(uid): # search through all UIDs. def GetFreeID(l): Attrs = l.search_s(BaseBaseDn,ldap.SCOPE_SUBTREE, - "uidNumber=*",["uidNumber", "gidNumber", "uid"]); + "(|(uidNumber=*)(gidNumber=*))",["uidNumber", "gidNumber", "uid"]); HighestUID = 0; gids = []; uids = []; @@ -249,7 +249,7 @@ if GuestAccount: shadowExpire = int(time.time() / 3600 / 24) + exp res = raw_input("Hosts to grant access to: ") for h in res.split(): - if not '.' in h: h = h + '.' + HostDomain + if '.' not in h: h = h + '.' + HostDomain if exp > 0: h = h + " " + datetime.datetime.fromtimestamp( time.time() + exp * 24*3600 ).strftime("%Y%m%d") hostacl.append(h)