summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2002-07-30 15:34:10 +0000
committerAndrew Tridgell <tridge@samba.org>2002-07-30 15:34:10 +0000
commit55c978d85ea9b2fbd3eeb597d4b383399c5106a7 (patch)
tree978052f38d5a9b665c3950ddbd6a301325514051 /source3/libads
parent9edc1cd4cfd3c02cfb1b867f8450384c446e8b60 (diff)
downloadsamba-55c978d85ea9b2fbd3eeb597d4b383399c5106a7.tar.gz
samba-55c978d85ea9b2fbd3eeb597d4b383399c5106a7.tar.bz2
samba-55c978d85ea9b2fbd3eeb597d4b383399c5106a7.zip
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)
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/ads_struct.c6
1 files changed, 6 insertions, 0 deletions
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;
}