From 140257208a848e49e1de5517287863755c8446dc Mon Sep 17 00:00:00 2001 From: Bruce Leidl Date: Thu, 3 Jan 2019 10:49:09 -0500 Subject: [PATCH] No need to use a loop device here --- libcitadel/src/verity.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/libcitadel/src/verity.rs b/libcitadel/src/verity.rs index f1417e6..bf9e611 100644 --- a/libcitadel/src/verity.rs +++ b/libcitadel/src/verity.rs @@ -32,16 +32,14 @@ pub fn generate_image_hashtree>(image: P, metainfo: &MetaInfo) -> pub fn verify_image>(image: P, metainfo: &MetaInfo) -> Result { let arg_offset = format!("--hash-offset={}", metainfo.nblocks() * 4096); - let loopdev = create_image_loop_device(image.as_ref())?; + let image = format!("{}", image.as_ref().display()); + let status = Command::new(VERITYSETUP) - .args(&[ arg_offset.as_str(), "verify", &loopdev, &loopdev, metainfo.verity_root()]) + .args(&[ arg_offset.as_str(), "verify", image.as_str(), image.as_str(), metainfo.verity_root()]) .stderr(Stdio::inherit()) .status()?; - util::exec_cmdline(LOSETUP, format!("-d {}", loopdev)) - .context("Error removing loop device created for verification")?; - Ok(status.success()) }