samdb/cracknames: do not show recycled when a guid is desired
authorBob Campbell <bobcampbell@catalyst.net.nz>
Tue, 4 Jul 2017 23:15:04 +0000 (11:15 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 24 Jul 2017 05:14:10 +0000 (07:14 +0200)
commitc186e02b40c921d33e23c8b2f7c5f1abb235a438
treeafef54be693b346b039bda1e74877c9ba93f978e
parent4779afe0d2dd14371b68e80f47d11942456bb365
samdb/cracknames: do not show recycled when a guid is desired

Previously, when a GUID was desired to
cracknames, it would include recycled objects as well. This would
sometimes result in two objects being returned from a query which is
supposed to return a unique GUID. For example, if a deleted user had
the same sAMAccountName as a non-deleted user and cracknames was used to
find the GUID of this account, it would return two GUIDs, and so would
fail with DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12842

Signed-off-by: Bob Campbell <bobcampbell@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
source4/dsdb/samdb/cracknames.c