Skip to content

Commit

Permalink
Fix a regression in error handling
Browse files Browse the repository at this point in the history
Commit fb6ffe0 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 <simo@redhat.com>
  • Loading branch information
simo5 committed May 20, 2016
1 parent 229441a commit 26597c6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/gss_creds.c
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down

0 comments on commit 26597c6

Please sign in to comment.