Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion crates/lib/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1227,7 +1227,8 @@ async fn run_from_opt(opt: Opt) -> Result<()> {
FsverityOpts::Enable { path } => {
let fd =
std::fs::File::open(&path).with_context(|| format!("Reading {path}"))?;
fsverity::enable_verity_raw::<fsverity::Sha256HashValue>(&fd)?;
// Note this is not robust to forks, we're not using the _maybe_copy variant
fsverity::enable_verity_with_retry::<fsverity::Sha256HashValue>(&fd)?;
Ok(())
}
},
Expand Down
6 changes: 5 additions & 1 deletion crates/ostree-ext/src/fsverity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,11 @@ fn enable_fsverity_in_objdir(d: &Dir) -> anyhow::Result<()> {
let enabled =
composefs::fsverity::measure_verity_opt::<Sha256HashValue>(f.as_fd())?.is_some();
if !enabled {
composefs_fsverity::enable_verity_raw::<Sha256HashValue>(&f)?;
// NOTE: We're not using the _with_copy API here because for us it'd require
// copying all the metadata too which is mildly tedious.
// For main composefs we don't need to care about the per-file metadata
// in general which simplifies a lot.
composefs_fsverity::enable_verity_with_retry::<Sha256HashValue>(f.as_fd())?;
}
}
Ok(())
Expand Down