summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2015-03-05 16:54:34 +0100
committerKarel Zak <kzak@redhat.com>2015-03-12 10:16:44 +0100
commitd239040764ad0b7100ffb6151486b9b6d3c6b617 (patch)
tree91cbc2bce7720643e4ca07e8e291c5d06db8d1e8
parent23dd342403042789aec5687eb4d80990ec5b9304 (diff)
downloadutil-linux-d239040764ad0b7100ffb6151486b9b6d3c6b617.tar.gz
logger: fix -p kern.* priority is accepted regression
Pre 2.26, syslog(3) was used for local logging, and it did not accept kern.* priorities. This is re-enabled by the patch.
-rw-r--r--misc-utils/logger.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/misc-utils/logger.c b/misc-utils/logger.c
index 5bdfeeeca..323661e74 100644
--- a/misc-utils/logger.c
+++ b/misc-utils/logger.c
@@ -173,6 +173,8 @@ static int pencode(char *s)
level = decode(s, prioritynames);
if (level < 0)
errx(EXIT_FAILURE, _("unknown priority name: %s"), s);
+ if(facility == LOG_KERN)
+ facility = LOG_USER; /* kern is forbidden */
return ((level & LOG_PRIMASK) | (facility & LOG_FACMASK));
}