summaryrefslogtreecommitdiffstats
path: root/source/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
commitfc0d5479b575c1f495b9251413eed18ec1e37e02 (patch)
treed61cbb5e1826adc5ac086858146ba8e85e451366 /source/libads
parent1a6dfddf6788b30fc81794b1bfe749693183b2c1 (diff)
downloadsamba-fc0d5479b575c1f495b9251413eed18ec1e37e02.tar.gz
samba-fc0d5479b575c1f495b9251413eed18ec1e37e02.tar.xz
samba-fc0d5479b575c1f495b9251413eed18ec1e37e02.zip
net ads info now reports the IP of the LDAP server as well as its name - very useful in scripts
Diffstat (limited to 'source/libads')
-rw-r--r--source/libads/ads_struct.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/libads/ads_struct.c b/source/libads/ads_struct.c
index 0be79673a00..af0b5d41431 100644
--- a/source/libads/ads_struct.c
+++ b/source/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;
}