From 26597c648d494f8757deec7da85bd4f0c340f06e Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 20 May 2016 15:26:07 -0400 Subject: [PATCH] Fix a regression in error handling Commit fb6ffe0c50e166bf095736a051e4840bd5a5ad4f introduced a regression in aqcuire_cred_from() where a processing error would be masked and a GSS_COMPLETE status would be returned instead. This caused a credential structure to be returned when no credentials are actually available. Signed-off-by: Simo Sorce --- src/gss_creds.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gss_creds.c b/src/gss_creds.c index 82e72a7..bf8c1df 100644 --- a/src/gss_creds.c +++ b/src/gss_creds.c @@ -376,6 +376,7 @@ uint32_t gssntlm_acquire_cred_from(uint32_t *minor_status, } if (retmin) { set_GSSERR(retmin); + goto done; } } else if (cred_usage == GSS_C_ACCEPT) { if (name != NULL && name->type != GSSNTLM_NAME_SERVER) { @@ -386,11 +387,14 @@ uint32_t gssntlm_acquire_cred_from(uint32_t *minor_status, retmin = get_server_creds(name, cred); if (retmin) { set_GSSERR(retmin); + goto done; } } else if (cred_usage == GSS_C_BOTH) { set_GSSERRS(ERR_NOTSUPPORTED, GSS_S_CRED_UNAVAIL); + goto done; } else { set_GSSERRS(ERR_BADARG, GSS_S_CRED_UNAVAIL); + goto done; } set_GSSERRS(0, GSS_S_COMPLETE);