[19056] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

libkrb5 APIs for wrapping errors

daemon@ATHENA.MIT.EDU (Greg Hudson)
Wed Nov 12 15:19:36 2014

From: Greg Hudson <ghudson@mit.edu>
To: krbdev@mit.edu
Date: Wed, 12 Nov 2014 15:18:37 -0500
Message-ID: <x7dzjbw18bm.fsf@equal-rites.mit.edu>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: krbdev-bounces@mit.edu

As part of the pull request implementing
http://mailman.mit.edu/pipermail/krbdev/2014-October/012199.html
we need to add some new APIs for wrapping error messages.

Currently we are looking at, from Heimdal:

void krb5_prepend_error_message(krb5_context ctx, krb5_error_code code,
                                const char *fmt, ...);
void krb5_vprepend_error_message(krb5_context ctx, krb5_error_code code,
                                 const char *fmt, va_list args);

These functions retrieve the message for code (which might be an
extended error or might just be the default message for code), process
fmt and args, and set an extended message for code which looks like
"<newmsg>: <oldmsg>".

Sometimes you also want to change the code from the one you're
wrapping.  For that we are considering:

void krb5_prepend_error_message2(krb5_context ctx, krb5_error_code old_code,
                                 krb5_error_code code, const char *fmt, ...);
void krb5_vprepend_error_message2(krb5_context ctx, krb5_error_code old_code,
                                  krb5_error_code code, const char *fmt,
                                  va_list args);

These functions retrieve the message for old_code and set one for code.

Any bikeshed opinions before this becomes set in stone?  There are
things I would perhaps change if Heimdal hadn't gotten to it first
(using shorter identifiers, maybe returning the new code for
convenience) but I don't want to be gratuitously different.
_______________________________________________
krbdev mailing list             krbdev@mit.edu
https://mailman.mit.edu/mailman/listinfo/krbdev

home help back first fref pref prev next nref lref last post