From fcdd2de143971b0f020531479ad18f57874aef30 Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Wed, 4 Jul 2007 05:46:24 +0000 Subject: 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 --- src/lib/gssapi/krb5/gssapi_krb5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/gssapi/krb5/gssapi_krb5.c') diff --git a/src/lib/gssapi/krb5/gssapi_krb5.c b/src/lib/gssapi/krb5/gssapi_krb5.c index a0953e0b23..224484f44b 100644 --- a/src/lib/gssapi/krb5/gssapi_krb5.c +++ b/src/lib/gssapi/krb5/gssapi_krb5.c @@ -186,7 +186,7 @@ int *out_caller_provided_name) *out_caller_provided_name = (k5_getspecific(K5_KEY_GSS_KRB5_CCACHE_NAME) != NULL); } - + *minor_status = 0; return GSS_S_COMPLETE; } @@ -220,6 +220,8 @@ kg_get_ccache_name (OM_uint32 *minor_status, const char **out_name) err = errno; } } + if (err && context) + save_error_info(err, context); if (context) krb5_free_context(context); } -- cgit