diff options
| author | Peter Jones <pjones@redhat.com> | 2013-11-06 13:59:02 -0500 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2013-11-06 13:59:02 -0500 |
| commit | 46002a3e36e1e32e6895df5d2ce7151269154acb (patch) | |
| tree | ce67c17a04e7e8253799f3c684bad2e0009194d3 | |
| parent | cb874edd0bbb02e69c91512b879713769675402b (diff) | |
| download | efi-boot-shim-46002a3e36e1e32e6895df5d2ce7151269154acb.tar.gz efi-boot-shim-46002a3e36e1e32e6895df5d2ce7151269154acb.zip | |
Fix check logic for SetupMode variable.
After going back and inspecting this further, the logic for "SetupMode"
being present at all was incorrect. Also initialize our state earlier
so it's sure to always be set.
Signed-off-by: Peter Jones <pjones@redhat.com>
| -rw-r--r-- | shim.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -471,11 +471,9 @@ static BOOLEAN secure_mode (void) } status = get_variable(L"SetupMode", &Data, &len, global_var); - if (status == EFI_SUCCESS) { - if (verbose) - console_notify(L"Platform is in setup mode\n"); - return FALSE; - } + if (status != EFI_SUCCESS) + return TRUE; + setupmode = *Data; FreePool(Data); @@ -1509,14 +1507,15 @@ static EFI_STATUS check_mok_sb (void) UINTN MokSBStateSize = 0; UINT32 attributes; + insecure_mode = 0; + ignore_db = 0; + status = get_variable_attr(L"MokSBState", &MokSBState, &MokSBStateSize, shim_lock_guid, &attributes); if (status != EFI_SUCCESS) return EFI_ACCESS_DENIED; - insecure_mode = 0; - /* * Delete and ignore the variable if it's been set from or could be * modified by the OS |
