diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-07-16 17:03:11 +0200 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2011-07-21 09:25:01 -0400 |
commit | 71c816362b52626977e32c90dcde5b9602a8d0d2 (patch) | |
tree | 8f29fcbb8de0050aa62d7f922be4ce40b7e81161 | |
parent | dd51e978a18ed130e9126f51843e50845e0d6767 (diff) | |
download | sssd-71c816362b52626977e32c90dcde5b9602a8d0d2.tar.gz sssd-71c816362b52626977e32c90dcde5b9602a8d0d2.tar.xz sssd-71c816362b52626977e32c90dcde5b9602a8d0d2.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.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c index 17b85c3f0..d2477bcf2 100644 --- a/src/providers/ldap/ldap_common.c +++ b/src/providers/ldap/ldap_common.c @@ -841,16 +841,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, |