deprecate krb5_get_err_text

This commit is contained in:
Love Hornquist Astrand
2009-10-12 09:37:54 -07:00
parent f5e2873be2
commit 8d84cfe5c2

View File

@@ -34,6 +34,7 @@
#define KRB5_DEPRECATED
#include "krb5_locl.h"
#include <com_right.h>
#undef __attribute__
#define __attribute__(x)
@@ -540,4 +541,32 @@ krb5_generate_subkey(krb5_context context,
return krb5_generate_subkey_extended(context, key, ETYPE_NULL, subkey);
}
/**
* Return the error string for the error code. The caller must not
* free the string.
*
* This function is deprecated since its not threadsafe.
*
* @param context Kerberos 5 context.
* @param code Kerberos error code.
*
* @return the error message matching code
*
* @ingroup krb5
*/
const char* KRB5_LIB_FUNCTION
krb5_get_err_text(krb5_context context, krb5_error_code code) KRB5_DEPRECATED
{
const char *p = NULL;
if(context != NULL)
p = com_right(context->et_list, code);
if(p == NULL)
p = strerror(code);
if (p == NULL)
p = "Unknown error";
return p;
}
#endif /* HEIMDAL_SMALLER */