diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-21 19:28:59 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-21 19:28:59 +0000 |
commit | 9a80838c5bb1d0b3ae673376c24e82c082570783 (patch) | |
tree | 5b67d48c5449281d96f958a4a6b1fb91ecf0a19d /usr.sbin/syslogd/syslogd.c | |
parent | 8019ef78e75d318ea016f9e634988ea10c1855c8 (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.c | 12 |
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') |