richardphibel / rpms / systemd

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