From 751291fd62da691de3f0c25a8a9a464b4b8318c6 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 30 Jan 1997 21:41:36 +0000 Subject: Shroud password lengths. svn path=/trunk/; revision=848 --- NEWS | 4 +++- driver.c | 26 ++++++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index da21d29e..ad9ede20 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ features -- * Whether or not carriage returns will be stripped on output is explicitly controllable with stripcr. +* fetchmail -v messages no longer reveal password lengths. + bugs -- * Correction to length-extraction code for servers that return (nnn octets). @@ -15,7 +17,7 @@ bugs -- * Correction to RF822 continuation code so it doesn't eat leading blank-led lines in the text. -There are 211 people on the fetchmail-friends list. +There are 212 people on the fetchmail-friends list. ------------------------------------------------------------------------------ fetchmail-3.2 (Mon Jan 27 02:51:10 EST 1997) diff --git a/driver.c b/driver.c index ee57a805..fd4e4155 100644 --- a/driver.c +++ b/driver.c @@ -1468,12 +1468,17 @@ va_dcl if (outlevel == O_VERBOSE) { - if (shroud) + char *cp; + + if (shroud && (cp = strstr(buf, shroud))) { - char *cp; + char *sp; - if ((cp = strstr(buf, shroud))) - memset(cp, '*', strlen(shroud)); + sp = cp + strlen(shroud); + *cp++ = '*'; + while (*sp) + *cp++ = *sp++; + *sp = '\0'; } buf[strlen(buf)-2] = '\0'; error(0, 0, "%s> %s", protocol->name, buf); @@ -1533,12 +1538,17 @@ va_dcl if (outlevel == O_VERBOSE) { - if (shroud) + char *cp; + + if (shroud && (cp = strstr(buf, shroud))) { - char *cp; + char *sp; - if ((cp = strstr(buf, shroud))) - memset(cp, '*', strlen(shroud)); + sp = cp + strlen(shroud); + *cp++ = '*'; + while (*sp) + *cp++ = *sp++; + *sp = '\0'; } buf[strlen(buf)-1] = '\0'; error(0, 0, "%s> %s", protocol->name, buf); -- cgit v1.2.3