Skip to content

Commit

Permalink
Check for efi variabales support after processing commands
Browse files Browse the repository at this point in the history
Options like help, version should work all the time.

Signed-off-by: Shreenidhi Shedi <[email protected]>
  • Loading branch information
sshedi authored and lcp committed Nov 10, 2023
1 parent f68a4f4 commit 5f49730
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/mokutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -1817,11 +1817,6 @@ main (int argc, char *argv[])
force_ca_check = 0;
check_keyring = 1;

if (!efi_variables_supported ()) {
fprintf (stderr, "EFI variables are not supported on this system\n");
exit (1);
}

while (1) {
static struct option long_options[] = {
{"help", no_argument, 0, 'h'},
Expand Down Expand Up @@ -2119,6 +2114,11 @@ main (int argc, char *argv[])
if (pw_hash_file && use_root_pw)
command |= HELP;

if (!(command & HELP) && !efi_variables_supported ()) {
fprintf (stderr, "EFI variables are not supported on this system\n");
exit (1);
}

if (db_name != MOK_LIST_RT && !(command & ~MOKX))
command |= LIST_ENROLLED;

Expand Down

0 comments on commit 5f49730

Please sign in to comment.