From 55c978d85ea9b2fbd3eeb597d4b383399c5106a7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 30 Jul 2002 15:34:10 +0000 Subject: net ads info now reports the IP of the LDAP server as well as its name - very useful in scripts (This used to be commit fc0d5479b575c1f495b9251413eed18ec1e37e02) --- source3/libads/ads_struct.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'source3/libads') diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c index 0be79673a0..af0b5d4143 100644 --- a/source3/libads/ads_struct.c +++ b/source3/libads/ads_struct.c @@ -162,6 +162,7 @@ ADS_STRUCT *ads_init(const char *realm, ads->ldap_server = strdup(lp_ads_server()); } if (!ads->ldap_server || !ads->ldap_server[0]) { + SAFE_FREE(ads->ldap_server); ads->ldap_server = find_ldap_server(ads); } } @@ -170,6 +171,11 @@ ADS_STRUCT *ads_init(const char *realm, ads->kdc_server = ads->ldap_server? strdup(ads->ldap_server) : NULL; } + if (ads->ldap_server) { + /* its very useful knowing the IP of the ldap server */ + ads->ldap_ip = *interpret_addr2(ads->ldap_server); + } + return ads; } -- cgit