aboutsummaryrefslogtreecommitdiffstats
path: root/driver.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1998-03-18 18:10:41 +0000
committerEric S. Raymond <esr@thyrsus.com>1998-03-18 18:10:41 +0000
commitf77a4eaa0c360870aa4cb7714203cbcec93f5d20 (patch)
treeb271465ca8a22e2d874b89a5cc152075b5c2f493 /driver.c
parenta8216bd4ee3b1d57dce12dbe3d0446cd7454f1f2 (diff)
downloadfetchmail-f77a4eaa0c360870aa4cb7714203cbcec93f5d20.tar.gz
fetchmail-f77a4eaa0c360870aa4cb7714203cbcec93f5d20.tar.bz2
fetchmail-f77a4eaa0c360870aa4cb7714203cbcec93f5d20.zip
Fix IMAP password shrouding.
svn path=/trunk/; revision=1712
Diffstat (limited to 'driver.c')
-rw-r--r--driver.c13
1 files changed, 8 insertions, 5 deletions
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)