summaryrefslogtreecommitdiff
path: root/usr.sbin/lpr/common_source
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2002-06-13 06:48:41 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2002-06-13 06:48:41 +0000
commit07ad6ff1c450d29d89afb16eadc39ecbf842365e (patch)
tree7216a440404f1eafa0ed541f72d8e30b975759d5 /usr.sbin/lpr/common_source
parenta965e01bad29a9ba78e1b2d29a39b46bd2d8a3b4 (diff)
Fixed some lpd bugs while on the plane from Calgary:
o mark fatal() as __dead o add SIGINT to the signal mask when installing abort() as a handler. We can end up in abortpr() due to several different signals and since abortpr() kill()s itself with SIGINT we need to explicately protect against the current process receiving SIGINT while in abortpr() o Don't leak the lock fd to children spawned by lpd o Close the lock file (and thus unlocke immediately in abortpr(). Otherwise, if there is an output filter the lock file only gets closed after we finish waiting for the output filter to die. This causes a race condition in lprm such that the per-printer daemon does not get restarted when lprm kills the active job (noticed during c2k2 with the mp3 printer spool ;-) o Open the printcap file with privs raised just in case it is not world-readable.
Diffstat (limited to 'usr.sbin/lpr/common_source')
-rw-r--r--usr.sbin/lpr/common_source/common.c6
-rw-r--r--usr.sbin/lpr/common_source/lp.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/lpr/common_source/common.c b/usr.sbin/lpr/common_source/common.c
index 5f6576627d6..a0723a429bf 100644
--- a/usr.sbin/lpr/common_source/common.c
+++ b/usr.sbin/lpr/common_source/common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: common.c,v 1.22 2002/06/09 03:56:28 millert Exp $ */
+/* $OpenBSD: common.c,v 1.23 2002/06/13 06:48:40 millert Exp $ */
/* $NetBSD: common.c,v 1.21 2000/08/09 14:28:50 itojun Exp $ */
/*
@@ -43,7 +43,7 @@
#if 0
static const char sccsid[] = "@(#)common.c 8.5 (Berkeley) 4/28/95";
#else
-static const char rcsid[] = "$OpenBSD: common.c,v 1.22 2002/06/09 03:56:28 millert Exp $";
+static const char rcsid[] = "$OpenBSD: common.c,v 1.23 2002/06/13 06:48:40 millert Exp $";
#endif
#endif /* not lint */
@@ -434,7 +434,7 @@ delay(int n)
(void) select(0, (fd_set *)0, (fd_set *)0, (fd_set *)0, &tdelay);
}
-void
+__dead void
fatal(const char *msg, ...)
{
extern char *__progname;
diff --git a/usr.sbin/lpr/common_source/lp.h b/usr.sbin/lpr/common_source/lp.h
index 98ffc67cca8..3c117b3566a 100644
--- a/usr.sbin/lpr/common_source/lp.h
+++ b/usr.sbin/lpr/common_source/lp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: lp.h,v 1.12 2002/06/09 03:56:28 millert Exp $ */
+/* $OpenBSD: lp.h,v 1.13 2002/06/13 06:48:40 millert Exp $ */
/* $NetBSD: lp.h,v 1.14 2000/04/16 14:43:58 mrg Exp $ */
/*
@@ -132,7 +132,7 @@ char *checkremote(void);
int chk(char *);
void displayq(int);
void dump(char *, char *, int);
-void fatal(const char *, ...)
+__dead void fatal(const char *, ...)
__attribute__((__format__(__printf__, 1, 2)));
int getline(FILE *);
int getport(char *, int);