libkrb5 APIs for wrapping errors

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

libkrb5 APIs for wrapping errors

Greg Hudson
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             [hidden email]
https://mailman.mit.edu/mailman/listinfo/krbdev