From 99875245107ba25c9a43210d8c123be379d7ce8f Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Fri, 5 Mar 2010 09:46:08 -0500 Subject: [PATCH] Windows: use krb5_get_error_message in netidmgr_plugin Use krb5_get_error_message to translate krb5 error messages to strings. LICENSE MIT Change-Id: Ia2fd5d655e4b0fa894ce724d4c123d2df433bb32 Reviewed-on: http://gerrit.openafs.org/1518 Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/netidmgr_plugin/dynimport.c | 4 ++++ src/WINNT/netidmgr_plugin/krb5common.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/WINNT/netidmgr_plugin/dynimport.c b/src/WINNT/netidmgr_plugin/dynimport.c index 51dcac3a7..6e53793c4 100644 --- a/src/WINNT/netidmgr_plugin/dynimport.c +++ b/src/WINNT/netidmgr_plugin/dynimport.c @@ -143,6 +143,8 @@ DECL_FUNC_PTR(krb5_free_host_realm); DECL_FUNC_PTR(krb5_c_random_make_octets); DECL_FUNC_PTR(krb5_free_addresses); DECL_FUNC_PTR(krb5_free_default_realm); +DECL_FUNC_PTR(krb5_get_error_message); +DECL_FUNC_PTR(krb5_free_error_message); // Krb524 functions DECL_FUNC_PTR(krb524_init_ets); @@ -287,6 +289,8 @@ FUNC_INFO k5_fi[] = { MAKE_FUNC_INFO(krb5_free_host_realm), MAKE_FUNC_INFO(krb5_c_random_make_octets), MAKE_FUNC_INFO(krb5_free_default_realm), + MAKE_FUNC_INFO(krb5_get_error_message), + MAKE_FUNC_INFO(krb5_free_error_message), END_FUNC_INFO }; diff --git a/src/WINNT/netidmgr_plugin/krb5common.c b/src/WINNT/netidmgr_plugin/krb5common.c index faaf6bceb..4a95046cd 100644 --- a/src/WINNT/netidmgr_plugin/krb5common.c +++ b/src/WINNT/netidmgr_plugin/krb5common.c @@ -50,12 +50,13 @@ khm_krb5_error(krb5_error_code rc, LPCSTR FailedFunctionName, const char *errText; int krb5Error = ((int)(rc & 255)); - errText = perror_message(rc); + errText = pkrb5_get_error_message(rc); _snprintf(message, sizeof(message), "%s\n(Kerberos error %ld)\n\n%s failed", errText, krb5Error, FailedFunctionName); + pkrb5_free_error_message(errText); MessageBoxA(NULL, message, "Kerberos Five", MB_OK | MB_ICONERROR | MB_TASKMODAL | -- 2.39.5