diff options
author | Sumit Bose <sbose@redhat.com> | 2010-05-14 12:16:59 +0200 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2010-05-27 14:44:13 -0400 |
commit | 717bab5b52c755c950eb451d95a805d474d0ef07 (patch) | |
tree | bee10494a7d77e19e0d79a421a2fb6ed58acd4ad /src/krb5_plugin | |
parent | 6126d57239edc0ed0fac8082e00cd4a685c0566d (diff) | |
download | sssd-717bab5b52c755c950eb451d95a805d474d0ef07.tar.gz sssd-717bab5b52c755c950eb451d95a805d474d0ef07.tar.bz2 sssd-717bab5b52c755c950eb451d95a805d474d0ef07.zip |
Krb5 locator plugin returns KRB5_PLUGIN_NO_HANDLE
To allow a fallback to the setting in krb5.conf the locator plugin
returns KRB5_PLUGIN_NO_HANDLE in nearly all error conditions. Only if the
call back fails the error code of the callback is returned.
Diffstat (limited to 'src/krb5_plugin')
-rw-r--r-- | src/krb5_plugin/sssd_krb5_locator_plugin.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/krb5_plugin/sssd_krb5_locator_plugin.c b/src/krb5_plugin/sssd_krb5_locator_plugin.c index 153145bb..dfc9c197 100644 --- a/src/krb5_plugin/sssd_krb5_locator_plugin.c +++ b/src/krb5_plugin/sssd_krb5_locator_plugin.c @@ -223,7 +223,7 @@ krb5_error_code sssd_krb5_locator_init(krb5_context context, const char *dummy; ctx = calloc(1,sizeof(struct sssd_ctx)); - if (ctx == NULL) return ENOMEM; + if (ctx == NULL) return KRB5_PLUGIN_NO_HANDLE; dummy = getenv(SSSD_KRB5_LOCATOR_DEBUG); if (dummy == NULL) { @@ -280,7 +280,7 @@ krb5_error_code sssd_krb5_locator_lookup(void *private_data, ctx->sssd_realm = strdup(realm); if (ctx->sssd_realm == NULL) { PLUGIN_DEBUG(("strdup failed.\n")); - return ENOMEM; + return KRB5_PLUGIN_NO_HANDLE; } ret = get_krb5info(realm, ctx, locate_service_kdc); @@ -326,7 +326,7 @@ krb5_error_code sssd_krb5_locator_lookup(void *private_data, case locate_service_krb524: return KRB5_PLUGIN_NO_HANDLE; default: - return EINVAL; + return KRB5_PLUGIN_NO_HANDLE; } switch (family) { @@ -343,7 +343,7 @@ krb5_error_code sssd_krb5_locator_lookup(void *private_data, case SOCK_DGRAM: break; default: - return EINVAL; + return KRB5_PLUGIN_NO_HANDLE; } if (strcmp(realm, ctx->sssd_realm) != 0) @@ -353,7 +353,7 @@ krb5_error_code sssd_krb5_locator_lookup(void *private_data, ret = snprintf(port_str, PORT_STR_SIZE-1, "%u", port); if (ret < 0 || ret >= (PORT_STR_SIZE-1)) { PLUGIN_DEBUG(("snprintf failed.\n")); - return EFAULT; + return KRB5_PLUGIN_NO_HANDLE; } memset(&ai_hints, 0, sizeof(struct addrinfo)); @@ -368,7 +368,7 @@ krb5_error_code sssd_krb5_locator_lookup(void *private_data, PLUGIN_DEBUG(("getaddrinfo failed [%d][%s].\n", errno, strerror(errno))); } - return EFAULT; + return KRB5_PLUGIN_NO_HANDLE; } PLUGIN_DEBUG(("addr[%s:%s] family[%d] socktype[%d]\n", addr, port_str, |