diff options
author | Ken Raeburn <raeburn@mit.edu> | 2007-07-04 05:46:24 +0000 |
---|---|---|
committer | Ken Raeburn <raeburn@mit.edu> | 2007-07-04 05:46:24 +0000 |
commit | fcdd2de143971b0f020531479ad18f57874aef30 (patch) | |
tree | 8bec355041d9241b90822a13548ca2ec45a9a884 /src/lib/gssapi/krb5/copy_ccache.c | |
parent | e0845c95210ca7cf4a03be23b034a2f29fc078c6 (diff) | |
download | krb5-fcdd2de143971b0f020531479ad18f57874aef30.tar.gz krb5-fcdd2de143971b0f020531479ad18f57874aef30.tar.xz krb5-fcdd2de143971b0f020531479ad18f57874aef30.zip |
gss krb5 mech enhanced error messages
Save detailed error messages (usually from the krb5 library) in
per-thread storage, mapping each error code to the most recently
produced message for it. Return the message from display_status.
Currently not implemented for a few cases where the krb5 mechanism
returns a minor status code of 0, or another value different from the
libkrb5 error code.
Other functions are available to store a generic string or formatted
message, but aren't used much at present.
Tested with these errors in context establishment:
* missing ccache (libkrb5 shows pathname if FILE: type)
* missing keytab (libkrb5 shows pathname if FILE: type)
* server principal unknown (libkrb5 shows server principal)
ticket: new
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19672 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/gssapi/krb5/copy_ccache.c')
-rw-r--r-- | src/lib/gssapi/krb5/copy_ccache.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib/gssapi/krb5/copy_ccache.c b/src/lib/gssapi/krb5/copy_ccache.c index 195be0f842..8ade9c5da8 100644 --- a/src/lib/gssapi/krb5/copy_ccache.c +++ b/src/lib/gssapi/krb5/copy_ccache.c @@ -41,6 +41,7 @@ gss_krb5int_copy_ccache(minor_status, cred_handle, out_ccache) if (code) { k5_mutex_unlock(&k5creds->lock); *minor_status = code; + save_error_info(*minor_status, context); krb5_free_context(context); return(GSS_S_FAILURE); } @@ -48,12 +49,9 @@ gss_krb5int_copy_ccache(minor_status, cred_handle, out_ccache) code = krb5_cc_store_cred(context, out_ccache, &creds); krb5_cc_end_seq_get(context, k5creds->ccache, &cursor); k5_mutex_unlock(&k5creds->lock); + *minor_status = code; + if (code) + save_error_info(*minor_status, context); krb5_free_context(context); - if (code) { - *minor_status = code; - return(GSS_S_FAILURE); - } else { - *minor_status = 0; - return(GSS_S_COMPLETE); - } + return code ? GSS_S_FAILURE : GSS_S_COMPLETE; } |