summaryrefslogtreecommitdiffstats
path: root/src/providers/ldap/sdap_async_sudo_hostinfo.c
diff options
context:
space:
mode:
authorMichal Zidek <mzidek@redhat.com>2012-10-15 12:21:00 +0200
committerJakub Hrozek <jhrozek@redhat.com>2013-01-02 17:44:09 +0100
commit04759b59e71c78ab23b84d13dd29d9c6dd680adb (patch)
treede8f6137712f7fc8ade86a7a89bb96905db3a240 /src/providers/ldap/sdap_async_sudo_hostinfo.c
parentfc647b8eb5bca901658dedf3dbda2f35c63a86f2 (diff)
downloadsssd-04759b59e71c78ab23b84d13dd29d9c6dd680adb.tar.gz
sssd-04759b59e71c78ab23b84d13dd29d9c6dd680adb.tar.xz
sssd-04759b59e71c78ab23b84d13dd29d9c6dd680adb.zip
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
Diffstat (limited to 'src/providers/ldap/sdap_async_sudo_hostinfo.c')
-rw-r--r--src/providers/ldap/sdap_async_sudo_hostinfo.c4
1 files changed, 2 insertions, 2 deletions
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,