fix(variables): set bool should have variable class parameter

This commit is contained in:
2025-11-01 02:26:53 -04:00
parent 812036fada
commit 7a7fcc71c0
2 changed files with 8 additions and 4 deletions

View File

@@ -1,7 +1,7 @@
use crate::integrations::shim::hook::SecurityHook; use crate::integrations::shim::hook::SecurityHook;
use crate::utils; use crate::utils;
use crate::utils::ResolvedPath; use crate::utils::ResolvedPath;
use crate::utils::variables::VariableController; use crate::utils::variables::{VariableClass, VariableController};
use anyhow::{Context, Result, anyhow, bail}; use anyhow::{Context, Result, anyhow, bail};
use log::warn; use log::warn;
use std::ffi::c_void; use std::ffi::c_void;
@@ -282,7 +282,11 @@ impl ShimSupport {
/// for the full lifetime of boot services. /// for the full lifetime of boot services.
pub fn retain() -> Result<()> { pub fn retain() -> Result<()> {
Self::SHIM_LOCK_VARIABLES Self::SHIM_LOCK_VARIABLES
.set_bool("ShimRetainProtocol", true) .set_bool(
"ShimRetainProtocol",
true,
VariableClass::BootAndRuntimeTemporary,
)
.context("unable to retain shim protocol")?; .context("unable to retain shim protocol")?;
Ok(()) Ok(())
} }

View File

@@ -95,7 +95,7 @@ impl VariableController {
/// Set a boolean variable specified by `key` to `value`, converting the value. /// Set a boolean variable specified by `key` to `value`, converting the value.
/// The variable `class` controls the attributes for the variable. /// The variable `class` controls the attributes for the variable.
pub fn set_bool(&self, key: &str, value: bool) -> Result<()> { pub fn set_bool(&self, key: &str, value: bool, class: VariableClass) -> Result<()> {
self.set(key, &[value as u8], VariableClass::BootAndRuntimeTemporary) self.set(key, &[value as u8], class)
} }
} }