]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
logger: fix -p kern.* priority is accepted regression
authorRainer Gerhards <rgerhards@adiscon.com>
Thu, 5 Mar 2015 15:54:34 +0000 (16:54 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 12 Mar 2015 09:16:44 +0000 (10:16 +0100)
Pre 2.26, syslog(3) was used for local logging, and it did not
accept kern.* priorities. This is re-enabled by the patch.

misc-utils/logger.c

index 5bdfeeecaa919c5610d0c797e2fc84b07ac5ea01..323661e7410c0e86de2b172e911911c8b06d7f0c 100644 (file)
@@ -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));
 }