From fe714cc411b6051e35c5e467306c16c2584e0c71 Mon Sep 17 00:00:00 2001 From: Alex Zenla Date: Tue, 28 Oct 2025 17:10:28 -0400 Subject: [PATCH] fix(filesystem-device-match): bail early if no criteria is provided --- src/extractors/filesystem_device_match.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/extractors/filesystem_device_match.rs b/src/extractors/filesystem_device_match.rs index a894d58..6a6a75a 100644 --- a/src/extractors/filesystem_device_match.rs +++ b/src/extractors/filesystem_device_match.rs @@ -88,6 +88,15 @@ pub fn extract( context: Rc, extractor: &FilesystemDeviceMatchExtractor, ) -> Result { + // If no criteria are provided, bail with an error. + if extractor.has_label.is_none() + && extractor.has_item.is_none() + && extractor.has_partition_uuid.is_none() + && extractor.has_partition_type_uuid.is_none() + { + bail!("at least one criteria is required for filesystem-device-match"); + } + // Find all the filesystems inside the UEFI stack. let handles = uefi::boot::find_handles::() .context("unable to find filesystem handles")?;