aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2010-04-29 20:16:45 +0200
committerMatthias Andree <matthias.andree@gmx.de>2010-04-29 20:40:36 +0200
commitbe9e00b0ca370a7620b57f4714db808742d8302e (patch)
treea3594e4481ea519cd8ad4930e91a26e2ea88b245
parent005cbf2a5709923e292e6909ed3663f1a83640da (diff)
downloadfetchmail-be9e00b0ca370a7620b57f4714db808742d8302e.tar.gz
fetchmail-be9e00b0ca370a7620b57f4714db808742d8302e.tar.bz2
fetchmail-be9e00b0ca370a7620b57f4714db808742d8302e.zip
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.
-rw-r--r--driver.c16
1 files 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