summaryrefslogtreecommitdiff
path: root/source3/libads/ads_struct.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-11-29 08:22:45 +0000
committerAndrew Tridgell <tridge@samba.org>2001-11-29 08:22:45 +0000
commit3a921f37b737cab0729cc904e514647406e6f01c (patch)
treeddaf811d52f9fde7be2b75abf8f636cf7fa0d6d8 /source3/libads/ads_struct.c
parent090acb27c3c2fe0562870ed9a1b13158d3d37767 (diff)
downloadsamba-3a921f37b737cab0729cc904e514647406e6f01c.tar.gz
samba-3a921f37b737cab0729cc904e514647406e6f01c.tar.bz2
samba-3a921f37b737cab0729cc904e514647406e6f01c.zip
ads->realm must not be NULL
perhaps we should just fail ads_init() in this case? (This used to be commit 2a4ce3de6ae8fb833370d1f9d6e5e7193fafa979)
Diffstat (limited to 'source3/libads/ads_struct.c')
-rw-r--r--source3/libads/ads_struct.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source3/libads/ads_struct.c b/source3/libads/ads_struct.c
index 84c12bf665..4227684375 100644
--- a/source3/libads/ads_struct.c
+++ b/source3/libads/ads_struct.c
@@ -103,6 +103,8 @@ static char *find_ldap_server(ADS_STRUCT *ads)
{
char *list = NULL;
+ if (!ads->realm) return NULL;
+
if (ldap_domain2hostlist(ads->realm, &list) == LDAP_SUCCESS) {
char *p;
p = strchr(list, ':');
@@ -149,6 +151,7 @@ ADS_STRUCT *ads_init(const char *realm,
if (!ads->realm[0]) {
ads->realm = get_default_realm(ads);
}
+ if (!ads->realm) ads->realm = strdup("");
}
if (!ads->bind_path) {
ads->bind_path = ads_build_dn(ads->realm);