From be9e00b0ca370a7620b57f4714db808742d8302e Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Thu, 29 Apr 2010 20:16:45 +0200 Subject: Also run Kerberos errors through sdump(). This allows us to get rid of the %*s/%s difference between Heimdal/MIT Kerberos translations, and prevents from server-provided data to be dumped directly on screen. --- driver.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/driver.c b/driver.c index 68a388d1..db8d52b8 100644 --- a/driver.c +++ b/driver.c @@ -53,6 +53,8 @@ #include "getaddrinfo.h" #include "tunable.h" +#include "sdump.h" + /* throw types for runtime errors */ #define THROW_TIMEOUT 1 /* server timed out */ @@ -246,15 +248,17 @@ const char *canonical; /* server name */ if (retval) { #ifdef HEIMDAL if (err_ret && err_ret->e_text) { + char *t = err_ret->e_text; + char *tt = sdump(t, strlen(t)); report(stderr, GT_("krb5_sendauth: %s [server says '%s']\n"), - error_message(retval), - err_ret->e_text); + error_message(retval), tt); + free(tt); #else if (err_ret && err_ret->text.length) { - report(stderr, GT_("krb5_sendauth: %s [server says '%*s']\n"), - error_message(retval), - err_ret->text.length, - err_ret->text.data); + char *tt = sdump(err_ret->text.data, err_ret->text.length); + report(stderr, GT_("krb5_sendauth: %s [server says '%s']\n"), + error_message(retval), tt); + free(tt); #endif krb5_free_error(context, err_ret); } else -- cgit v1.2.3