From 818ec32d0c4dde545199b4462da30b49a19ecc87 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 26 Apr 2011 17:03:32 +1000 Subject: s3-libads Pass a struct sockaddr_storage to cldap routines This avoids these routines doing a DNS lookup that has already been done, and ensures that the emulated DNS lookup isn't thrown away. Andrew Bartlett --- source3/winbindd/idmap_adex/gc_util.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'source3/winbindd') diff --git a/source3/winbindd/idmap_adex/gc_util.c b/source3/winbindd/idmap_adex/gc_util.c index 77b318cb2d..e625265be0 100644 --- a/source3/winbindd/idmap_adex/gc_util.c +++ b/source3/winbindd/idmap_adex/gc_util.c @@ -107,6 +107,7 @@ done: NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; struct NETLOGON_SAM_LOGON_RESPONSE_EX cldap_reply; TALLOC_CTX *frame = talloc_stackframe(); + struct sockaddr_storage ss; if (!gc || !domain) { return NT_STATUS_INVALID_PARAMETER; @@ -126,8 +127,17 @@ done: nt_status = ads_ntstatus(ads_status); BAIL_ON_NTSTATUS_ERROR(nt_status); + if (!resolve_name(ads->config.ldap_server_name, &ss, 0x20, true)) { + DEBUG(5,("gc_find_forest_root: unable to resolve name %s\n", + ads->config.ldap_server_name)); + nt_status = NT_STATUS_IO_TIMEOUT; + /* This matches the old code which did the resolve in + * ads_cldap_netlogon_5 */ + BAIL_ON_NTSTATUS_ERROR(nt_status); + } + if (!ads_cldap_netlogon_5(frame, - ads->config.ldap_server_name, + &ss, ads->config.realm, &cldap_reply)) { -- cgit