chiark / gitweb /
addrcheck: Don't spew userv error messages at SMTP clients. mdw/addrcheck
authorMark Wooding <mdw@distorted.org.uk>
Thu, 16 Mar 2006 23:01:38 +0000 (23:01 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Thu, 16 Mar 2006 23:15:14 +0000 (23:15 +0000)
They don't like it.  Whose stupid idea was it to send stderr to the
socket in inetd anyway?

addrcheck.c

index 496c5ddf82dab27f95cc63ef11ecd360bd88e6a8..0b189a77b14fa55f5a956332a69fa5f9481d348d 100644 (file)
@@ -5,6 +5,7 @@
 #include "addrcheck.h"
 #include <errno.h>
 #include <unistd.h>
+#include <fcntl.h>
 
 /* #define DEBUG */
 #ifdef DEBUG
@@ -131,9 +132,10 @@ static int localprobe(int cdb, const char *sender,
     if (pipe(p) || (kid = fork()) == -1)
       return (-1);
     if (!kid) {
+      close(0); open("/dev/null", O_RDONLY);
       dup2(p[1], 1);
-      close(p[0]);
-      close(p[1]);
+      close(2); open("/dev/null", O_WRONLY);
+      close(p[0]); close(p[1]);
       execl("/usr/bin/userv", "/usr/bin/userv",
            "-f", "stdin=/dev/null",
            u.s, serv.s,