summaryrefslogtreecommitdiffstats
path: root/src/lib/gssapi/krb5/add_cred.c
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2007-07-04 05:46:24 +0000
committerKen Raeburn <raeburn@mit.edu>2007-07-04 05:46:24 +0000
commitfcdd2de143971b0f020531479ad18f57874aef30 (patch)
tree8bec355041d9241b90822a13548ca2ec45a9a884 /src/lib/gssapi/krb5/add_cred.c
parente0845c95210ca7cf4a03be23b034a2f29fc078c6 (diff)
downloadkrb5-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/add_cred.c')
-rw-r--r--src/lib/gssapi/krb5/add_cred.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/lib/gssapi/krb5/add_cred.c b/src/lib/gssapi/krb5/add_cred.c
index 6110193953..3ac32fc2e7 100644
--- a/src/lib/gssapi/krb5/add_cred.c
+++ b/src/lib/gssapi/krb5/add_cred.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2000 by the Massachusetts Institute of Technology.
+ * Copyright 2000, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
@@ -122,6 +122,7 @@ krb5_gss_add_cred(minor_status, input_cred_handle,
major_status = krb5_gss_validate_cred_1(minor_status, input_cred_handle,
context);
if (GSS_ERROR(major_status)) {
+ save_error_info(*minor_status, context);
krb5_free_context(context);
return major_status;
}
@@ -150,6 +151,7 @@ krb5_gss_add_cred(minor_status, input_cred_handle,
}
if (GSS_ERROR(kg_sync_ccache_name(context, minor_status))) {
+ save_error_info(*minor_status, context);
krb5_free_context(context);
return GSS_S_FAILURE;
}
@@ -203,6 +205,7 @@ krb5_gss_add_cred(minor_status, input_cred_handle,
xfree(new_cred);
*minor_status = code;
+ save_error_info(*minor_status, context);
krb5_free_context(context);
return(GSS_S_FAILURE);
}
@@ -232,6 +235,7 @@ krb5_gss_add_cred(minor_status, input_cred_handle,
xfree(new_cred);
*minor_status = code;
+ save_error_info(*minor_status, context);
krb5_free_context(context);
return(GSS_S_FAILURE);
}
@@ -243,6 +247,7 @@ krb5_gss_add_cred(minor_status, input_cred_handle,
xfree(new_cred);
*minor_status = code;
+ save_error_info(*minor_status, context);
krb5_free_context(context);
return(GSS_S_FAILURE);
}
@@ -261,8 +266,9 @@ krb5_gss_add_cred(minor_status, input_cred_handle,
krb5_free_principal(context, new_cred->princ);
xfree(new_cred);
- krb5_free_context(context);
*minor_status = code;
+ save_error_info(*minor_status, context);
+ krb5_free_context(context);
return(GSS_S_FAILURE);
}
} else {
@@ -301,9 +307,10 @@ krb5_gss_add_cred(minor_status, input_cred_handle,
if (new_cred->princ)
krb5_free_principal(context, new_cred->princ);
xfree(new_cred);
- krb5_free_context(context);
*minor_status = code;
+ save_error_info(*minor_status, context);
+ krb5_free_context(context);
return(GSS_S_FAILURE);
}
} else {