1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-22 16:59:09 +03:00

s4-samdb: give a better exception if multiple users match in password change

This commit is contained in:
Andrew Tridgell
2010-11-29 16:57:25 +11:00
parent c522cd73ac
commit dc0c89cf40

View File

@ -372,7 +372,8 @@ member: %s
expression=search_filter, attrs=[])
if len(res) == 0:
raise Exception('Unable to find user "%s"' % (username or search_filter))
assert(len(res) == 1)
if len(res) > 1:
raise Exception('Matched %u multiple users with filter "%s"' % (len(res), search_filter))
user_dn = res[0].dn
setpw = """
dn: %s