diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-08-08 16:15:48 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-08-08 16:15:48 +0000 |
commit | 45e8f3d13cdad8e41387d908a65776c5e19960a5 (patch) | |
tree | 2a0cf4fb9bc0802959b3047ad120df4f7e581bcd /gnu/usr.sbin/sendmail | |
parent | 39232592a3e75d76de02bf691a7f216e0732ce2a (diff) |
Prevent logging strerror(0) on EOF; patch sent to sendmail-bugs@sendmail.ORG
Diffstat (limited to 'gnu/usr.sbin/sendmail')
-rw-r--r-- | gnu/usr.sbin/sendmail/sendmail/collect.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gnu/usr.sbin/sendmail/sendmail/collect.c b/gnu/usr.sbin/sendmail/sendmail/collect.c index 27c8c4636a8..64bfc1ddd9f 100644 --- a/gnu/usr.sbin/sendmail/sendmail/collect.c +++ b/gnu/usr.sbin/sendmail/sendmail/collect.c @@ -470,7 +470,12 @@ nextstate: readerr: if ((feof(fp) && smtpmode) || ferror(fp)) { - const char *errmsg = errstring(errno); + const char *errmsg; + + if (feof(fp)) + errmsg = "unexpected close"; + else + errmsg = errstring(errno); if (tTd(30, 1)) dprintf("collect: premature EOM: %s\n", errmsg); @@ -566,10 +571,9 @@ readerr: problem = "read timeout"; if (LogLevel > 0 && feof(fp)) sm_syslog(LOG_NOTICE, e->e_id, - "collect: %s on connection from %.100s, sender=%s: %s", + "collect: %s on connection from %.100s, sender=%s", problem, host, - shortenstring(e->e_from.q_paddr, MAXSHORTSTR), - errstring(errno)); + shortenstring(e->e_from.q_paddr, MAXSHORTSTR)); if (feof(fp)) usrerr("451 4.4.1 collect: %s on connection from %s, from=%s", problem, host, |