summaryrefslogtreecommitdiffstats
path: root/usr.sbin/syslogd/syslogd.c
diff options
context:
space:
mode:
authortobias <tobias@openbsd.org>2014-12-07 13:59:55 +0000
committertobias <tobias@openbsd.org>2014-12-07 13:59:55 +0000
commitfaacf66271838674bd366a53f94ae02a95df895b (patch)
treef4fb56b2e3f9bc044a851d70647997236709a890 /usr.sbin/syslogd/syslogd.c
parentmake sure we always nul-terminate (diff)
downloadwireguard-openbsd-faacf66271838674bd366a53f94ae02a95df895b.tar.xz
wireguard-openbsd-faacf66271838674bd366a53f94ae02a95df895b.zip
Fix regression for priority "none" (spotted by doug) of last commit by not
parsing numbers at all -- syslog.conf(5) explicitly states that keywords have to be used. ok millert
Diffstat (limited to 'usr.sbin/syslogd/syslogd.c')
-rw-r--r--usr.sbin/syslogd/syslogd.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c
index 0a41c3d353b..43470886753 100644
--- a/usr.sbin/syslogd/syslogd.c
+++ b/usr.sbin/syslogd/syslogd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: syslogd.c,v 1.133 2014/12/06 12:18:32 tobias Exp $ */
+/* $OpenBSD: syslogd.c,v 1.134 2014/12/07 13:59:55 tobias Exp $ */
/*
* Copyright (c) 1983, 1988, 1993, 1994
@@ -1498,7 +1498,7 @@ cfline(char *line, char *prog)
}
pri = decode(buf, prioritynames);
- if (pri < 0 || pri > LOG_PRIMASK) {
+ if (pri < 0) {
(void)snprintf(ebuf, sizeof ebuf,
"unknown priority name \"%s\"", buf);
logerror(ebuf);
@@ -1517,7 +1517,7 @@ cfline(char *line, char *prog)
f->f_pmask[i] = pri;
else {
i = decode(buf, facilitynames);
- if (i < 0 || (i >> 3) > LOG_NFACILITIES) {
+ if (i < 0) {
(void)snprintf(ebuf, sizeof(ebuf),
"unknown facility name \"%s\"",
buf);
@@ -1764,9 +1764,6 @@ decode(const char *name, const CODE *codetab)
const CODE *c;
char *p, buf[40];
- if (isdigit((unsigned char)*name))
- return (atoi(name));
-
for (p = buf; *name && p < &buf[sizeof(buf) - 1]; p++, name++) {
if (isupper((unsigned char)*name))
*p = tolower((unsigned char)*name);