From: Lennart Poettering Date: Mon, 11 Dec 2017 21:15:03 +0000 (+0100) Subject: bootctl: don't trip up in "bootctl status" when we can't find the ESP because of... X-Git-Tag: v236~24^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ecec2a5d7a6b5259beffba02771945bc46ddfd06;p=thirdparty%2Fsystemd.git bootctl: don't trip up in "bootctl status" when we can't find the ESP because of lack of privilges On my system the boot and EFI partitions are protected, hence "bootctl status" can't find the ESP, and then the tool continues with arg_path == NULL, which it really should not. Handle these cases, and simply suppress all output that needs arg_path. --- diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 52207661cf6..a5700992d4d 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -999,9 +999,11 @@ static int verb_status(int argc, char *argv[], void *userdata) { } else printf("System:\n Not booted with EFI\n\n"); - k = status_binaries(arg_path, uuid); - if (k < 0) - r = k; + if (arg_path) { + k = status_binaries(arg_path, uuid); + if (k < 0) + r = k; + } if (is_efi_boot()) { k = status_variables(); @@ -1009,9 +1011,11 @@ static int verb_status(int argc, char *argv[], void *userdata) { r = k; } - k = status_entries(arg_path, uuid); - if (k < 0) - r = k; + if (arg_path) { + k = status_entries(arg_path, uuid); + if (k < 0) + r = k; + } return r; }