From ad6a307d0447b772851e968b5eb2f91a21e6a923 Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Mon, 3 Jan 2011 22:45:47 +1100 Subject: [PATCH] Treat GSS_C_NO_CRED identically to GSS_C_CRED_UNAVAIL --- plugins/gs2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/gs2.c b/plugins/gs2.c index 930d70b..bb04c77 100644 --- a/plugins/gs2.c +++ b/plugins/gs2.c @@ -1481,6 +1481,7 @@ gs2_escape_authzid(const sasl_utils_t *utils, } #define GOT_CREDS(text, params) ((text)->client_creds != NULL || (params)->gss_creds != NULL) +#define CRED_ERROR(status) ((status) == GSS_S_CRED_UNAVAIL || (status) == GSS_S_NO_CRED) static int gs2_get_init_creds(context_t *text, @@ -1531,7 +1532,7 @@ gs2_get_init_creds(context_t *text, NULL); if (GSS_ERROR(maj_stat)) goto cleanup; - } else if (maj_stat != GSS_S_CRED_UNAVAIL) + } else if (!CRED_ERROR(maj_stat)) goto cleanup; if (text->client_name != GSS_C_NO_NAME) { @@ -1617,7 +1618,7 @@ gs2_get_init_creds(context_t *text, &text->client_creds, NULL, &text->lifetime); - if (maj_stat != GSS_S_COMPLETE && maj_stat != GSS_S_CRED_UNAVAIL) + if (GSS_ERROR(maj_stat) && !CRED_ERROR(maj_stat)) goto cleanup; } -- 2.1.4