X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=ud-useradd;h=6c2e19d4f43286566b79793b6067a4c1d0ab6f53;hb=19664646ceb4434b7f483c81c864e6d44f654038;hp=74008e5bbffd561937acb88d2deda9ccaaf03287;hpb=65b2c0e97ea1a08f194f9b56aa0c80e2f86ae460;p=mirror%2Fuserdir-ldap.git diff --git a/ud-useradd b/ud-useradd index 74008e5..6c2e19d 100755 --- a/ud-useradd +++ b/ud-useradd @@ -89,6 +89,11 @@ while len(Keys[0][1]) < 40: if Res == "": break; +Attrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"keyfingerprint=" + Keys[0][1]); +if len(Attrs) != 0: + print "*** This key already belongs to",GetAttr(Attrs[0],"uid"); + account = GetAttr(Attrs[0],"uid"); + # Try to get a uniq account name Update=0 while 1: