From owner-freebsd-ports Sat Dec 29 16:40: 8 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 6EA3037B41A for ; Sat, 29 Dec 2001 16:40:02 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id fBU0e2363163; Sat, 29 Dec 2001 16:40:02 -0800 (PST) (envelope-from gnats) Received: from alchemy.franken.de (alchemy.franken.de [194.94.249.218]) by hub.freebsd.org (Postfix) with ESMTP id 86D4337B405 for ; Sat, 29 Dec 2001 16:30:23 -0800 (PST) Received: from alchemy.franken.de (markus@localhost [127.0.0.1]) by alchemy.franken.de (8.12.1/8.12.1/ALCHEMY.FRANKEN.DE) with ESMTP id fBU0UfHb097066; Sun, 30 Dec 2001 01:30:50 +0100 (CET) (envelope-from corex@alchemy.franken.de) Received: (from corex@localhost) by alchemy.franken.de (8.12.1/8.12.1/Submit) id fBU0UcfY097065; Sun, 30 Dec 2001 01:30:38 +0100 (CET) (envelope-from corex) Message-Id: <200112300030.fBU0UcfY097065@alchemy.franken.de> Date: Sun, 30 Dec 2001 01:30:38 +0100 (CET) From: marius@alchemy.franken.de Reply-To: marius@alchemy.franken.de To: FreeBSD-gnats-submit@freebsd.org Cc: jonny@jonny.eng.br X-Send-Pr-Version: 3.113 Subject: ports/33314: [patch] ports/mail/smtpd: smtpfwdd causes sendmail 8.12.1 to complain about missing file descriptors Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >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