summaryrefslogtreecommitdiff
path: root/source3/libads/ads_struct.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/libads/ads_struct.c')
-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;
}