From 9b97b80dd8d29278de209fcecfdfd95a46863eb8 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Thu, 7 Jun 2012 23:21:48 +0100 Subject: [PATCH] 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 --- src/aklog/aklog.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/aklog/aklog.c b/src/aklog/aklog.c index 4e2b2debc2..ce64768093 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