From: Lennart Poettering Date: Thu, 23 Nov 2017 21:02:10 +0000 (+0100) Subject: logind: don't propagate firmware misbehaviours to bus clients X-Git-Tag: v236~125^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f302ce676a2b822564cc7361c527da74d0067a4;p=thirdparty%2Fsystemd.git logind: don't propagate firmware misbehaviours to bus clients 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. --- diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c index df8cb369fb6..df14c9e7115 100644 --- a/src/login/logind-dbus.c +++ b/src/login/logind-dbus.c @@ -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,