summaryrefslogtreecommitdiff
path: root/usr.sbin/syslogd/syslogd.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-03-21 19:28:59 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-03-21 19:28:59 +0000
commit9a80838c5bb1d0b3ae673376c24e82c082570783 (patch)
tree5b67d48c5449281d96f958a4a6b1fb91ecf0a19d /usr.sbin/syslogd/syslogd.c
parent8019ef78e75d318ea016f9e634988ea10c1855c8 (diff)
Fix default facility when none is specified (should be LOG_USER,
was LOG_UUCP due to a bug); Javier Kohen
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r--usr.sbin/syslogd/syslogd.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 9cf8c91c0a5..30a0457c7c1 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.59 2002/12/22 17:19:42 mickey Exp $ */
+/* $OpenBSD: syslogd.c,v 1.60 2003/03/21 19:28:58 millert Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)syslogd.c 8.3 (Berkeley) 4/4/94";
#else
-static char rcsid[] = "$OpenBSD: syslogd.c,v 1.59 2002/12/22 17:19:42 mickey Exp $";
+static char rcsid[] = "$OpenBSD: syslogd.c,v 1.60 2003/03/21 19:28:58 millert Exp $";
#endif
#endif /* not lint */
@@ -500,9 +500,13 @@ printline(char *hname, char *msg)
if (pri &~ (LOG_FACMASK|LOG_PRIMASK))
pri = DEFUPRI;
- /* don't allow users to log kernel messages */
+ /*
+ * Don't allow users to log kernel messages.
+ * NOTE: since LOG_KERN == 0 this will also match
+ * messages with no facility specified.
+ */
if (LOG_FAC(pri) == LOG_KERN)
- pri = LOG_MAKEPRI(LOG_USER, LOG_PRI(pri));
+ pri = LOG_USER | LOG_PRI(pri);
for (q = line; *p && q < &line[sizeof(line) - 4]; p++) {
if (*p == '\n')