1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

netlogon: Allow zero-GUID to act the same as NULL in GetDCNameEx2

This matches Windows behaviour and allows rpcclient to work against
Samba without knowing the GUID ahead of time. Errors related to this
don't appear to occur within selftest.

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

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Garming Sam <garming@samba.org>
Autobuild-Date(master): Fri May  4 09:11:19 CEST 2018 on sn-devel-144
This commit is contained in:
Garming Sam 2018-03-27 12:19:31 +13:00 committed by Garming Sam
parent 7b56b522d4
commit d1730d6ff1

View File

@ -2845,6 +2845,14 @@ static WERROR dcesrv_netr_DsRGetDCName_base_call(struct dcesrv_netr_DsRGetDCName
return WERR_INVALID_FLAGS;
}
/*
* If we send an all-zero GUID, we should ignore it as winbind actually
* checks it with a DNS query. Windows also appears to ignore it.
*/
if (r->in.domain_guid != NULL && GUID_all_zero(r->in.domain_guid)) {
r->in.domain_guid = NULL;
}
/* Attempt winbind search only if we suspect the domain is incorrect */
if (r->in.domain_name != NULL && strcmp("", r->in.domain_name) != 0) {
if (r->in.flags & DS_IS_FLAT_NAME) {