From 1177b12fbc82bfa0aef3ebd761bd4d715dd72cbd Mon Sep 17 00:00:00 2001 From: John Denker Date: Sat, 14 Jul 2012 12:03:16 -0700 Subject: fix bug in auth patch: it was re-assigning stderr, thereby causing log messages to go astray and break the stmp protocol --- qmail-smtpd.c | 4 +++- tools/smtp.conf | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/qmail-smtpd.c b/qmail-smtpd.c index 90f62d9..0ec6fe9 100644 --- a/qmail-smtpd.c +++ b/qmail-smtpd.c @@ -490,13 +490,15 @@ int authenticate(void) if (!stralloc_0(&pass)) die_nomem(); if (!stralloc_0(&resp)) die_nomem(); - if (fd_copy(2,1) == -1) return err_pipe(); if (pipe(pi) == -1) return err_pipe(); switch(child = fork()) { case -1: return err_fork(); case 0: close(pi[1]); +//xx Not sure why this fd_copy is helpful; +//xx why not let checkpasswd talk to the logfile via stderr? +//xx if (fd_copy(2,1) == -1) _exit(1); if (0 > fd_copy(3,pi[0])) _exit(1); sig_pipedefault(); execvp(*childargs, childargs); diff --git a/tools/smtp.conf b/tools/smtp.conf index 5263f7a..559e2c2 100644 --- a/tools/smtp.conf +++ b/tools/smtp.conf @@ -1,4 +1,5 @@ # /etc/stunnel/smtp.conf +cert = /etc/stunnel/stunnel.pem foreground = yes exec = /var/qmail/bin/qmail-smtpd execargs = qmail-smtpd 0 /var/qmail/rbin/checkpassword - -- cgit v1.2.3