aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>1997-07-18 14:39:28 +0000
committerEric S. Raymond <esr@thyrsus.com>1997-07-18 14:39:28 +0000
commita47dfbdfc70cec2c960e1de8562e38fabac27434 (patch)
treecc6ddccc083ef6e51d209d79ed3b1bb34c3cc1a8
parent5b6b38cbd82468ac720d25b1889f63f4251bf4db (diff)
downloadfetchmail-a47dfbdfc70cec2c960e1de8562e38fabac27434.tar.gz
fetchmail-a47dfbdfc70cec2c960e1de8562e38fabac27434.tar.bz2
fetchmail-a47dfbdfc70cec2c960e1de8562e38fabac27434.zip
Better password security.
svn path=/trunk/; revision=1174
-rw-r--r--fetchmail.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/fetchmail.c b/fetchmail.c
index 3b8fa05f..7810ec9b 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -658,11 +658,26 @@ void termhook(int sig)
{
struct query *ctl;
+ /*
+ * Craig Metz, the RFC1938 one-time-password guy, points out:
+ * "Remember that most kernels don't zero pages before handing them to the
+ * next process and many kernels share pages between user and kernel space.
+ * You'd be very surprised what you can find from a short program to do a
+ * malloc() and then dump the contents of the pages you got. By zeroing
+ * the secrets at end of run (earlier if you can), you make sure the next
+ * guy can't get the password/pass phrase."
+ *
+ * Right you are, Craig!
+ */
+ for (ctl = querylist; ctl; ctl = ctl->next)
+ if (ctl->password)
+ memset(ctl->password, '\0', strlen(ctl->password));
+
/*
* Sending SMTP QUIT on signal is theoretically nice, but led to a
* subtle bug. If fetchmail was terminated by signal while it was
* shipping message text, it would hang forever waiting for a
- * command acknowledge. In theory we could disable the QUIT
+ * command acknowledge. In theory we could enable the QUIT
* only outside of the message send. In practice, we don't
* care. All mailservers hang up on a dropped TCP/IP connection
* anyway.