Date: Sun, 30 Dec 2001 01:30:38 +0100 (CET) From: marius@alchemy.franken.de To: FreeBSD-gnats-submit@freebsd.org Cc: jonny@jonny.eng.br Subject: ports/33314: [patch] ports/mail/smtpd: smtpfwdd causes sendmail 8.12.1 to complain about missing file descriptors Message-ID: <200112300030.fBU0UcfY097065@alchemy.franken.de>
next in thread | raw e-mail | index | archive | help
>Number: 33314 >Category: ports >Synopsis: [patch] ports/mail/smtpd: smtpfwdd causes sendmail 8.12.1 to complain about missing file descriptors >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Dec 29 16:40:01 PST 2001 >Closed-Date: >Last-Modified: >Originator: marius@alchemy.franken.de >Release: FreeBSD 4.4-20011210-STABLE i386 >Organization: >Environment: System: FreeBSD alchemy.franken.de 4.4-20011210-STABLE FreeBSD 4.4-20011210-STABLE #0: Mon Dec 17 22:12:30 CET 2001 root@alchemy.franken.de:/usr/src/sys/compile/alchemy i386 >Description: since version 8.12.1 (8.12.0 ?) sendmail complains if a program piping data to it doesn't have stdin, stdout and stderr opened; smtpfwdd doesn't open stdout and stderr when forwarding a mail to sendmail, therefore an anoying system messages is generated for each incoming mail: Dec 30 00:05:44 alchemy sendmail[96078]: SYSERR(uucp): File descriptors missing on startup: stdout, stderr: Bad file descriptor >How-To-Repeat: use current ports/mail/sendmail (version 8.12.1) together with smtpd >Fix: just open /dev/null as stdout and stderr... --- smtpfwdd.c.orig Wed Dec 26 16:29:37 2001 +++ smtpfwdd.c Sun Dec 30 00:09:19 2001 @@ -636,6 +636,19 @@ exit(EX_OSERR); } + /* + * Open /dev/null as stdout and as stderr so sendmail 8.12.1 (and + * above ?) won't complain about missing file descriptors. + */ + if (open ("/dev/null", O_WRONLY | O_APPEND) < 0) { + syslog(LOG_ERR, "Couldn't open /dev/null as stdout (%m)"); + exit (EX_OSERR); + } + if (open ("/dev/null", O_RDWR | O_APPEND) < 0) { + syslog(LOG_ERR, "Couldn't open /dev/null as stderr (%m)"); + exit (EX_OSERR); + } + fclose(f); closelog(); if (lseek(0, body, SEEK_SET) < 0) { >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200112300030.fBU0UcfY097065>