]> 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)
committerRainer Gerhards <rgerhards@adiscon.com>
Thu, 5 Mar 2015 15:54:34 +0000 (16:54 +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 5ec722efe24c0d0fe9490075a55488bb70fbcf8d..06f0759b5d5a246156d11f4f34ae8ff6b0a6fafc 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));
 }