krb5 commit: Use k5_change_error_message_code in krb5 GSS mech

Greg Hudson ghudson at MIT.EDU
Wed May 7 12:56:48 EDT 2014


https://github.com/krb5/krb5/commit/035eb79b3f250b690502c66aaf664410b1d0e7e0
commit 035eb79b3f250b690502c66aaf664410b1d0e7e0
Author: Greg Hudson <ghudson at mit.edu>
Date:   Mon Apr 28 12:27:11 2014 -0400

    Use k5_change_error_message_code in krb5 GSS mech
    
    Simplify acquire_accept_cred using the new helper function.

 src/lib/gssapi/krb5/acquire_cred.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/src/lib/gssapi/krb5/acquire_cred.c b/src/lib/gssapi/krb5/acquire_cred.c
index 5d680f9..a31bc11 100644
--- a/src/lib/gssapi/krb5/acquire_cred.c
+++ b/src/lib/gssapi/krb5/acquire_cred.c
@@ -226,10 +226,7 @@ acquire_accept_cred(krb5_context context, OM_uint32 *minor_status,
         code = check_keytab(context, kt, cred->name);
         if (code) {
             if (code == KRB5_KT_NOTFOUND) {
-                char *errstr = (char *)krb5_get_error_message(context, code);
-                krb5_set_error_message(context, KG_KEYTAB_NOMATCH, "%s",
-                                       errstr);
-                krb5_free_error_message(context, errstr);
+                k5_change_error_message_code(context, code, KG_KEYTAB_NOMATCH);
                 code = KG_KEYTAB_NOMATCH;
             }
             major = GSS_S_CRED_UNAVAIL;


More information about the cvs-krb5 mailing list