summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-07-16 17:03:11 +0200
committerSimo Sorce <ssorce@redhat.com>2011-07-21 08:19:40 -0400
commita9fac774429097a8cf8c945fab94768fc7e87c05 (patch)
tree959673060306b9408ac4ee5d1c8a56f656999dbb
parent72e60fd4eabcfbcdbfe01e8c38b94052bc6c2067 (diff)
downloadsssd-a9fac774429097a8cf8c945fab94768fc7e87c05.tar.gz
sssd-a9fac774429097a8cf8c945fab94768fc7e87c05.tar.bz2
sssd-a9fac774429097a8cf8c945fab94768fc7e87c05.zip
Do not add a NULL host parsed from LDAP URI
https://fedorahosted.org/sssd/ticket/911
-rw-r--r--src/providers/ldap/ldap_common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c
index b28a348f..f2729f3e 100644
--- a/src/providers/ldap/ldap_common.c
+++ b/src/providers/ldap/ldap_common.c
@@ -851,16 +851,23 @@ int sdap_service_init(TALLOC_CTX *memctx, struct be_ctx *ctx,
goto done;
}
+ if (lud->lud_host == NULL) {
+ DEBUG(2, ("The LDAP URI (%s) did not contain a host name\n",
+ list[i]));
+ ldap_free_urldesc(lud);
+ continue;
+ }
+
DEBUG(6, ("Added URI %s\n", list[i]));
talloc_steal(service, list[i]);
ret = be_fo_add_server(ctx, service->name,
lud->lud_host, lud->lud_port, list[i]);
+ ldap_free_urldesc(lud);
if (ret) {
goto done;
}
- ldap_free_urldesc(lud);
}
ret = be_fo_service_add_callback(memctx, ctx, service->name,