ryantimwilson / rpms / systemd

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