]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: don't propagate firmware misbehaviours to bus clients
authorLennart Poettering <lennart@poettering.net>
Thu, 23 Nov 2017 21:02:10 +0000 (22:02 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 24 Nov 2017 10:57:23 +0000 (11:57 +0100)
If for some reason we can't query the firmware state, don't propagate
that to clients, but instead log about it, and claim that
reboot-to-firmware is not available (which is the right answer, since it
is not working).

Let's log about this though, as this is certainly relevant to know, even
though not for the client.

src/login/logind-dbus.c

index df8cb369fb62ff6747d3cf5a967a0c21ae95037e..df14c9e7115d190b3d5414f454eda23f95f082c7 100644 (file)
@@ -2397,7 +2397,7 @@ static int property_get_reboot_to_firmware_setup(
 
         r = efi_get_reboot_to_firmware();
         if (r < 0 && r != -EOPNOTSUPP)
-                return r;
+                log_warning_errno(r, "Failed to determine reboot-to-firmware state: %m");
 
         return sd_bus_message_append(reply, "b", r > 0);
 }
@@ -2451,10 +2451,12 @@ static int method_can_reboot_to_firmware_setup(
         assert(m);
 
         r = efi_reboot_to_firmware_supported();
-        if (r == -EOPNOTSUPP)
+        if (r < 0) {
+                if (r != -EOPNOTSUPP)
+                        log_warning_errno(errno, "Failed to determine whether reboot to firmware is supported: %m");
+
                 return sd_bus_reply_method_return(message, "s", "na");
-        else if (r < 0)
-                return r;
+        }
 
         r = bus_test_polkit(message,
                             CAP_SYS_ADMIN,