From f2e969268d965338338be09d261bde31c5c2ff8b Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 25 Nov 2001 00:08:48 +0000 Subject: better auto-selection of realm and ldap server (This used to be commit 69d256af4612f5c1277202eb8a7ef37eb6bb55f4) --- source3/libads/ldap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'source3/libads') diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c index 568e220c0b..c3d80a09ec 100644 --- a/source3/libads/ldap.c +++ b/source3/libads/ldap.c @@ -69,8 +69,6 @@ char *ads_errstr(int rc) /* find the ldap server from DNS - this won't work till we add a DNS packet parser. Talk about a - lousy resolv interface! */ static char *find_ldap_server(ADS_STRUCT *ads) { @@ -111,7 +109,10 @@ ADS_STRUCT *ads_init(const char *realm, ads->bind_path = ads_build_dn(ads->realm); } if (!ads->ldap_server) { - ads->ldap_server = find_ldap_server(ads); + ads->ldap_server = lp_ads_server(); + if (!ads->ldap_server[0]) { + ads->ldap_server = find_ldap_server(ads); + } } if (!ads->kdc_server) { /* assume its the same as LDAP */ -- cgit