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-18 13:06:43 -0400
commiteea8d1fe65e5985bdba3dda1414497c668887c76 (patch)
tree185e5d4445558168ee7263d93d23f62a22c94081
parent43452c83befb2585e1081302f4f0add83ef5572a (diff)
downloadsssd-eea8d1fe65e5985bdba3dda1414497c668887c76.tar.gz
sssd-eea8d1fe65e5985bdba3dda1414497c668887c76.tar.xz
sssd-eea8d1fe65e5985bdba3dda1414497c668887c76.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,