From f77a4eaa0c360870aa4cb7714203cbcec93f5d20 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Wed, 18 Mar 1998 18:10:41 +0000 Subject: Fix IMAP password shrouding. svn path=/trunk/; revision=1712 --- driver.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'driver.c') diff --git a/driver.c b/driver.c index e8c51017..aa908ecd 100644 --- a/driver.c +++ b/driver.c @@ -105,9 +105,9 @@ char tag[TAGLEN]; static int tagnum; #define GENSYM (sprintf(tag, "A%04d", ++tagnum % TAGMOD), tag) -static char *shroud; /* string to shroud in debug output, if non-NULL */ -static int mytimeout; /* value of nonreponse timeout */ -static int msglen; /* actual message length */ +static char shroud[PASSWORDLEN]; /* string to shroud in debug output */ +static int mytimeout; /* value of nonreponse timeout */ +static int msglen; /* actual message length */ /* use these to track what was happening when the nonresponse timer fired */ #define GENERAL_WAIT 0 /* unknown wait type */ @@ -1891,9 +1891,12 @@ const struct method *proto; /* protocol method table */ /* try to get authorized to fetch mail */ if (protocol->getauth) { - shroud = ctl->password; + if (protocol->password_canonify) + (protocol->password_canonify)(shroud, ctl->password); + else + strcpy(shroud, ctl->password); + ok = (protocol->getauth)(sock, ctl, buf); - shroud = (char *)NULL; if (ok != 0) { if (ok == PS_LOCKBUSY) -- cgit v1.2.3