get_dc_name() in source3/libsmb/namequery_dc.c fails when ads_dc_name() succeeds but no domain is specified in the original call to get_dc_name(). It appears that the point of get_dc_name() is to attempt to use ads if appropriate, and fall back on rpc if ads fails. However, if ads_dc_name() succeeds get_dc_name() still returns false if the pass-in domain is NULL. This affects the ability of winbindd/idmap_adex to look up information, and probably affects other areas of the system as well.
Created attachment 5982 [details] patch to get_dc_name() Proposed patch