summaryrefslogtreecommitdiff
path: root/qmail-smtpd.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-06-03 00:54:47 (GMT)
committerJohn Denker <jsd@av8n.com>2012-06-03 00:57:17 (GMT)
commit72937a56ee2beec1732797e1fc4cbe8ea057e4ca (patch)
tree0daf2fdd817b259a1d5e78880e3d96367da74aa5 /qmail-smtpd.c
parent22d3da72492f2b0939d11f1bf0a2b23a4f69ec63 (diff)
Minor bugfix. If you use morercpthosts, after a failed authentication
attempt, if the client attempts to send mail to a domain which is not listed in rcpthosts, qmail-smtpd is unable to read morercpthosts.cdb. Instead, it sends "421 unable to read controls (#4.3.0)" and drops the connection. This patch fixes this bug by closing file descriptor 3 (only if necessary) in the authentication child process rather than the parent process. Credit: Tom Clegg
Diffstat (limited to 'qmail-smtpd.c')
-rw-r--r--qmail-smtpd.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/qmail-smtpd.c b/qmail-smtpd.c
index 7390eb4..dc029ae 100644
--- a/qmail-smtpd.c
+++ b/qmail-smtpd.c
@@ -459,14 +459,13 @@ int authenticate(void)
if (!stralloc_0(&resp)) die_nomem();
if (fd_copy(2,1) == -1) return err_pipe();
- close(3);
if (pipe(pi) == -1) return err_pipe();
- if (pi[0] != 3) return err_pipe();
switch(child = fork()) {
case -1:
return err_fork();
case 0:
close(pi[1]);
+ if (0 > fd_copy(3,pi[0])) _exit(1);
sig_pipedefault();
execvp(*childargs, childargs);
_exit(1);