summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-04-26 17:03:32 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-04-28 05:30:20 +0200
commit818ec32d0c4dde545199b4462da30b49a19ecc87 (patch)
treeb9ef927164f792e495ffb768448e47a206f9f6a6 /source3/winbindd
parentaa8406cadf62ea676ffb7a6239a8b3f4fe71abbf (diff)
downloadsamba-818ec32d0c4dde545199b4462da30b49a19ecc87.tar.gz
samba-818ec32d0c4dde545199b4462da30b49a19ecc87.tar.bz2
samba-818ec32d0c4dde545199b4462da30b49a19ecc87.zip
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
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/idmap_adex/gc_util.c12
1 files changed, 11 insertions, 1 deletions
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))
{