diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-12-30 00:27:15 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-12-30 00:27:15 +0000 |
commit | bff2a125444555c75ab07568cf2f55b0715a1e34 (patch) | |
tree | d388986b6e83aa3a52f4d245dc7796bf9e9c7dac /libexec | |
parent | c26967b026015b1d4e28090c7c0bba39675c9be3 (diff) |
setup stdout & stderr; marius@alchemy.franken.de
Diffstat (limited to 'libexec')
-rw-r--r-- | libexec/smtpd/src/smtpfwdd.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libexec/smtpd/src/smtpfwdd.c b/libexec/smtpd/src/smtpfwdd.c index 2fcc3e26ac6..9b08f77e52d 100644 --- a/libexec/smtpd/src/smtpfwdd.c +++ b/libexec/smtpd/src/smtpfwdd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpfwdd.c,v 1.7 2001/08/23 14:17:08 aaron Exp $*/ +/* $OpenBSD: smtpfwdd.c,v 1.8 2001/12/30 00:27:14 deraadt Exp $*/ /* * smtpfwdd, Obtuse SMTP forward daemon, master process watches spool @@ -42,7 +42,7 @@ */ char *obtuse_copyright = "Copyright 1996 - Obtuse Systems Corporation - All rights reserved."; -char *obtuse_rcsid = "$OpenBSD: smtpfwdd.c,v 1.7 2001/08/23 14:17:08 aaron Exp $"; +char *obtuse_rcsid = "$OpenBSD: smtpfwdd.c,v 1.8 2001/12/30 00:27:14 deraadt Exp $"; #include <stdio.h> #include <signal.h> @@ -646,6 +646,19 @@ forward(char *fname) 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) { |