From: Simon Wilkinson Date: Thu, 7 Jun 2012 22:21:48 +0000 (+0100) Subject: aklog: Fix error message fallback for Heimdal X-Git-Tag: upstream/1.8.0_pre1^2~2332 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=9b97b80dd8d29278de209fcecfdfd95a46863eb8;p=packages%2Fo%2Fopenafs.git aklog: Fix error message fallback for Heimdal Since we reverted to using Russ's upstream version of rra-c-util's krb5.m4, we no longer check for the existence of the pure com_err error_message(). So, for error message fallback on Heimdal, use krb5_get_error_message() instead. As we don't have access to the context in which the error occurred, build one to get the raw com_err error translation - this won't give us any additional context specific detail. Change-Id: I4bab080704ec5d08e8b85e6b7ad69cf1f89bf3b3 Reviewed-on: http://gerrit.openafs.org/7554 Tested-by: BuildBot Reviewed-by: Alistair Ferguson Reviewed-by: Derrick Brashear --- diff --git a/src/aklog/aklog.c b/src/aklog/aklog.c index 4e2b2debc..ce6476809 100644 --- a/src/aklog/aklog.c +++ b/src/aklog/aklog.c @@ -310,8 +310,11 @@ redirect_errors(const char *who, afs_int32 code, const char *fmt, va_list ap) if (strncmp(str, "unknown", strlen("unknown")) == 0) { #ifdef HAVE_KRB5_SVC_GET_MSG krb5_svc_get_msg(code,&str); -#elif defined(HAVE_ERROR_MESSAGE) - str = error_message(code); +#elif defined(HAVE_KRB5_GET_ERROR_MESSAGE) + krb5_context context; + krb5_init_context(&context); + str = krb5_get_error_message(context, code); + krb5_free_context(context); #else ; /* IRIX apparently has neither: use the string we have */ #endif