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 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'qmail-smtpd.c') 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); -- cgit v1.2.3