From 7c3b26910d16894a6ad98906f0de82dc2f23a611 Mon Sep 17 00:00:00 2001 From: SATOH Fumiyasu Date: Thu, 5 Feb 2009 14:16:43 +0900 Subject: [PATCH] ads_connect(): Use resolved IP address instead of short DNS name Because ads->config.ldap_server_name has a short (non-FQDN) hostname, it cannot be resolved on some situation (e.g. DNS domainname and/or search suffix != AD domainname) and ldap_open_with_timeout() failed. See also https://bugzilla.samba.org/show_bug.cgi?id=3906 --- source/libads/ldap.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/source/libads/ldap.c b/source/libads/ldap.c index 47b9f3e..f3ab2e5 100644 --- a/source/libads/ldap.c +++ b/source/libads/ldap.c @@ -479,7 +479,6 @@ got_connection: } if (!ads->auth.kdc_server) { - print_sockaddr(addr, sizeof(addr), &ads->ldap.ss); ads->auth.kdc_server = SMB_STRDUP(addr); } @@ -509,7 +508,7 @@ got_connection: /* Otherwise setup the TCP LDAP session */ - ads->ldap.ld = ldap_open_with_timeout(ads->config.ldap_server_name, + ads->ldap.ld = ldap_open_with_timeout(addr, LDAP_PORT, lp_ldap_timeout()); if (ads->ldap.ld == NULL) { status = ADS_ERROR(LDAP_OPERATIONS_ERROR); -- 1.5.6.5