From 44d0fd9bfdcab991f00ba33c91f49527f8cce595 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Tue, 18 Feb 2014 13:17:11 +0100 Subject: sdap: move non async functions from sdap_async_connection.c to sdap_utils.c Reviewed-by: Jakub Hrozek --- src/providers/ldap/sdap_async_connection.c | 18 ------------------ src/providers/ldap/sdap_utils.c | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/providers') diff --git a/src/providers/ldap/sdap_async_connection.c b/src/providers/ldap/sdap_async_connection.c index 7103976e6..abc5b1755 100644 --- a/src/providers/ldap/sdap_async_connection.c +++ b/src/providers/ldap/sdap_async_connection.c @@ -30,24 +30,6 @@ #include "providers/ldap/sdap_async_private.h" #include "providers/ldap/ldap_common.h" -errno_t deref_string_to_val(const char *str, int *val) -{ - if (strcasecmp(str, "never") == 0) { - *val = LDAP_DEREF_NEVER; - } else if (strcasecmp(str, "searching") == 0) { - *val = LDAP_DEREF_SEARCHING; - } else if (strcasecmp(str, "finding") == 0) { - *val = LDAP_DEREF_FINDING; - } else if (strcasecmp(str, "always") == 0) { - *val = LDAP_DEREF_ALWAYS; - } else { - DEBUG(SSSDBG_CRIT_FAILURE, "Illegal deref option [%s].\n", str); - return EINVAL; - } - - return EOK; -} - /* ==Connect-to-LDAP-Server=============================================== */ struct sdap_rebind_proc_params { diff --git a/src/providers/ldap/sdap_utils.c b/src/providers/ldap/sdap_utils.c index 194f4a133..d1e886d4c 100644 --- a/src/providers/ldap/sdap_utils.c +++ b/src/providers/ldap/sdap_utils.c @@ -140,3 +140,21 @@ done: talloc_free(tmp_ctx); return ret; } + +errno_t deref_string_to_val(const char *str, int *val) +{ + if (strcasecmp(str, "never") == 0) { + *val = LDAP_DEREF_NEVER; + } else if (strcasecmp(str, "searching") == 0) { + *val = LDAP_DEREF_SEARCHING; + } else if (strcasecmp(str, "finding") == 0) { + *val = LDAP_DEREF_FINDING; + } else if (strcasecmp(str, "always") == 0) { + *val = LDAP_DEREF_ALWAYS; + } else { + DEBUG(SSSDBG_CRIT_FAILURE, "Illegal deref option [%s].\n", str); + return EINVAL; + } + + return EOK; +} -- cgit