summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/lpd/printjob.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-28 18:04:19 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1996-06-28 18:04:19 +0000
commite260aba41c43915261ee84534709d75055a5bd3e (patch)
tree1f4452cd93545c31640c7c9b71ebad26b6922c03 /usr.sbin/lpr/lpd/printjob.c
parentb4a8e14bbb57716235b35101143c09ba8ab2f590 (diff)
closelog() before we trash syslog descriptor
Diffstat (limited to 'usr.sbin/lpr/lpd/printjob.c')
-rw-r--r--usr.sbin/lpr/lpd/printjob.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/lpr/lpd/printjob.c b/usr.sbin/lpr/lpd/printjob.c
index b5f48abde27..484657db437 100644
--- a/usr.sbin/lpr/lpd/printjob.c
+++ b/usr.sbin/lpr/lpd/printjob.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: printjob.c,v 1.2 1996/05/05 16:14:50 deraadt Exp $ */
+/* $OpenBSD: printjob.c,v 1.3 1996/06/28 18:04:18 deraadt Exp $ */
/* $NetBSD: printjob.c,v 1.9 1996/04/30 00:07:00 jtc Exp $ */
/*
@@ -541,6 +541,7 @@ print(format, file)
if ((prchild = dofork(DORETURN)) == 0) { /* child */
dup2(fi, 0); /* file is stdin */
dup2(p[1], 1); /* pipe is stdout */
+ closelog();
for (n = 3; n < NOFILE; n++)
(void) close(n);
execl(_PATH_PR, "pr", width, length,
@@ -654,6 +655,7 @@ start:
n = open(tempfile, O_WRONLY|O_CREAT|O_TRUNC, 0664);
if (n >= 0)
dup2(n, 2);
+ closelog();
for (n = 3; n < NOFILE; n++)
(void) close(n);
execv(prog, av);
@@ -1011,6 +1013,7 @@ sendmail(user, bombed)
pipe(p);
if ((s = dofork(DORETURN)) == 0) { /* child */
dup2(p[0], 0);
+ closelog();
for (i = 3; i < NOFILE; i++)
(void) close(i);
if ((cp = rindex(_PATH_SENDMAIL, '/')) != NULL)
@@ -1266,6 +1269,7 @@ openpr()
if ((ofilter = dofork(DOABORT)) == 0) { /* child */
dup2(p[0], 0); /* pipe is std in */
dup2(pfd, 1); /* printer is std out */
+ closelog();
for (i = 3; i < NOFILE; i++)
(void) close(i);
if ((cp = rindex(OF, '/')) == NULL)