valeriyvdovin / rpms / systemd

Forked from rpms/systemd 4 years ago
Clone

Blame SOURCES/0445-udev-fix-crash-with-invalid-udev.log-priority.patch

803fb7
From 22423054480ed8dee70160e9e886ca372b3440f3 Mon Sep 17 00:00:00 2001
803fb7
From: Michal Schmidt <mschmidt@redhat.com>
803fb7
Date: Tue, 21 Jul 2015 18:26:09 +0200
803fb7
Subject: [PATCH] udev: fix crash with invalid udev.log-priority
803fb7
803fb7
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1245293
803fb7
803fb7
Conflicts:
803fb7
	src/udev/udevd.c
803fb7
803fb7
Cherry-picked from: e00f5bddde0daff900cbd93e1ee0530ad1ae06ce
803fb7
Resolves: #1245293
803fb7
---
803fb7
 src/udev/udevd.c | 5 ++++-
803fb7
 1 file changed, 4 insertions(+), 1 deletion(-)
803fb7
803fb7
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
803fb7
index 21e7e7f9a..82c7a5425 100644
803fb7
--- a/src/udev/udevd.c
803fb7
+++ b/src/udev/udevd.c
803fb7
@@ -990,7 +990,10 @@ static void kernel_cmdline_options(struct udev *udev) {
803fb7
                         int prio;
803fb7
 
803fb7
                         prio = util_log_priority(value);
803fb7
-                        log_set_max_level(prio);
803fb7
+                        if (prio < 0)
803fb7
+                                log_warning("Invalid udev.log-priority ignored: %s", value);
803fb7
+                        else
803fb7
+                                log_set_max_level(prio);
803fb7
                 } else if ((value = startswith(opt, "udev.children-max="))) {
803fb7
                         r = safe_atoi(value, &arg_children_max);
803fb7
                         if (r < 0)