From 04759b59e71c78ab23b84d13dd29d9c6dd680adb Mon Sep 17 00:00:00 2001 From: Michal Zidek Date: Mon, 15 Oct 2012 12:21:00 +0200 Subject: failover: Protect against empty host names Added new parameter to split_on_separator that allows to skip empty values. The whole function was rewritten. Unit test case was added to check the new implementation. https://fedorahosted.org/sssd/ticket/1484 --- src/providers/ldap/sdap_async_sudo_hostinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/providers/ldap/sdap_async_sudo_hostinfo.c') diff --git a/src/providers/ldap/sdap_async_sudo_hostinfo.c b/src/providers/ldap/sdap_async_sudo_hostinfo.c index 0a695cdbf..f47e98651 100644 --- a/src/providers/ldap/sdap_async_sudo_hostinfo.c +++ b/src/providers/ldap/sdap_async_sudo_hostinfo.c @@ -89,7 +89,7 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, conf_ip_addr = dp_opt_get_string(opts->basic, SDAP_SUDO_IP); if (conf_hostnames != NULL) { - ret = split_on_separator(state, conf_hostnames, ' ', true, + ret = split_on_separator(state, conf_hostnames, ' ', true, true, &state->hostnames, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, @@ -102,7 +102,7 @@ struct tevent_req * sdap_sudo_get_hostinfo_send(TALLOC_CTX *mem_ctx, } if (conf_ip_addr != NULL) { - ret = split_on_separator(state, conf_ip_addr, ' ', true, + ret = split_on_separator(state, conf_ip_addr, ' ', true, true, &state->ip_addr, NULL); if (ret != EOK) { DEBUG(SSSDBG_MINOR_FAILURE, -- cgit