summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2010-05-14 12:16:59 +0200
committerStephen Gallagher <sgallagh@redhat.com>2010-05-27 14:44:13 -0400
commit717bab5b52c755c950eb451d95a805d474d0ef07 (patch)
treebee10494a7d77e19e0d79a421a2fb6ed58acd4ad
parent6126d57239edc0ed0fac8082e00cd4a685c0566d (diff)
downloadsssd-717bab5b52c755c950eb451d95a805d474d0ef07.tar.gz
sssd-717bab5b52c755c950eb451d95a805d474d0ef07.tar.xz
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.
-rw-r--r--src/krb5_plugin/sssd_krb5_locator_plugin.c12
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 153145bb1..dfc9c197c 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,