[PATCH] inititialize krb5 error-tables

Love lha at stacken.kth.se
Tue Jul 20 19:50:22 GMT 2004

Guenther Deschner <gd at sernet.de> writes:

> Hi,
> attached is a proposal of how error-message() *could* be used in a more
> consistent way with MIT and Heimdal Kerberos within Samba.

if you do something like this with heimdal you get mostly more relevant
error strings (and sometimes highly confusing once because we forget to
reset the error string). Not compile tested, but you get the idea:

      err_str = krb5_get_error_string(context);
      if (err_str == NULL)
      	  err_msg = krb5_get_err_text(context, code);
          err_msg = err_str;
      if (err_msg == NULL)
	  err_msg = "<unknown error>";
      printf("here is the error message %s", err_msg);
      if (err_str)
         krb5_free_error_string(context, err_str);

The et-array is stored within the krb5_context, and not using the global
et array, this way we don't need to make libcom_err threadsafe.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 477 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20040720/d2aef539/attachment.bin

More information about the samba-technical mailing list