diff options
author | Andrew Tridgell <tridge@samba.org> | 2008-08-30 07:38:02 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2008-08-30 07:38:02 +1000 |
commit | e82f2187325274d728ec7470990f971e7b3db13c (patch) | |
tree | 25ce940a5b2a57c6191265664fad0e70aee951fa /source4/heimdal/lib/gssapi/krb5/display_status.c | |
parent | 9817f3d785ceb67819a9def0e8030272e4ba9e14 (diff) | |
parent | 81dcc99e9acb9a7e4c2358e5e44998e4718dc658 (diff) | |
download | samba-e82f2187325274d728ec7470990f971e7b3db13c.tar.gz samba-e82f2187325274d728ec7470990f971e7b3db13c.tar.bz2 samba-e82f2187325274d728ec7470990f971e7b3db13c.zip |
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-test
(This used to be commit f008c3b6ee324056fd9b63f6151ad6849640c959)
Diffstat (limited to 'source4/heimdal/lib/gssapi/krb5/display_status.c')
-rw-r--r-- | source4/heimdal/lib/gssapi/krb5/display_status.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/source4/heimdal/lib/gssapi/krb5/display_status.c b/source4/heimdal/lib/gssapi/krb5/display_status.c index f932261ffa..52a651c506 100644 --- a/source4/heimdal/lib/gssapi/krb5/display_status.c +++ b/source4/heimdal/lib/gssapi/krb5/display_status.c @@ -33,7 +33,7 @@ #include "krb5/gsskrb5_locl.h" -RCSID("$Id: display_status.c 23316 2008-06-23 04:32:32Z lha $"); +RCSID("$Id$"); static const char * calling_error(OM_uint32 v) @@ -122,7 +122,7 @@ _gsskrb5_clear_status (void) } void -_gsskrb5_set_status (const char *fmt, ...) +_gsskrb5_set_status (int ret, const char *fmt, ...) { krb5_context context; va_list args; @@ -135,7 +135,7 @@ _gsskrb5_set_status (const char *fmt, ...) vasprintf(&str, fmt, args); va_end(args); if (str) { - krb5_set_error_message(context, 0, str); + krb5_set_error_message(context, ret, str); free(str); } } @@ -171,14 +171,13 @@ OM_uint32 _gsskrb5_display_status calling_error(GSS_CALLING_ERROR(status_value)), routine_error(GSS_ROUTINE_ERROR(status_value))); } else if (status_type == GSS_C_MECH_CODE) { - buf = krb5_get_error_string(context); - if (buf == NULL) { - const char *tmp = krb5_get_err_text (context, status_value); - if (tmp == NULL) - asprintf(&buf, "unknown mech error-code %u", - (unsigned)status_value); - else - buf = strdup(tmp); + const char *buf2 = krb5_get_error_message(context, status_value); + if (buf2) { + buf = strdup(buf2); + krb5_free_error_message(context, buf2); + } else { + asprintf(&buf, "unknown mech error-code %u", + (unsigned)status_value); } } else { *minor_status = EINVAL; |