Skip to content

Commit

Permalink
verity: also check corruption in existing mounts
Browse files Browse the repository at this point in the history
If we are mounting a mol where one of the atoms already been mounted,
then we should check the already-mounted devices for any corruption
reported by devicemapper as well, and at least fail to mount the new
image using them.

Signed-off-by: Michael McCracken <[email protected]>
  • Loading branch information
mikemccracken committed Sep 26, 2024
1 parent 872badb commit abbd1a8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions molecule.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ func (m Molecule) mountUnderlyingAtoms() error {
if err != nil {
return err
}
err = squashfs.ConfirmExistingVerityDeviceCurrentValidity(mountpoint.Source,
rootHash)
if err != nil {
return err

Check warning on line 67 in molecule.go

View check run for this annotation

Codecov / codecov/patch

molecule.go#L64-L67

Added lines #L64 - L67 were not covered by tests
}
}
continue
}
Expand Down

0 comments on commit abbd1a8

Please sign in to comment.