Implement and natively verify the human-reviewed Windows recovery tool
Rust development slice / linux (push) Failing after 7s

This commit is contained in:
2026-11-15 23:27:14 +01:00
parent a537517428
commit fd17b6c662
12 changed files with 1109 additions and 243 deletions
+17
View File
@@ -233,6 +233,23 @@ impl Store {
value.check()?;
Ok(value)
}
/// Verify the original protected journal and retain a read-only snapshot of its empty history.
pub fn open_empty_history_snapshot() -> Result<Self> {
let store = Self::open(false)?;
ensure!(
store.db.is_readonly(rusqlite::DatabaseName::Main)?,
"read-only intent snapshot required"
);
store
.db
.execute_batch("PRAGMA trusted_schema=OFF; PRAGMA query_only=ON; BEGIN")?;
let count: usize = store.db.query_row(
"SELECT (SELECT count(*) FROM system_intents)+(SELECT count(*) FROM system_intent_mirrors)+(SELECT count(*) FROM system_intent_denial_resumes)",
[], |r|r.get(0),
)?;
ensure!(count == 0, "unreviewed SYSTEM delegation");
Ok(store)
}
pub fn check(&mut self) -> Result<()> {
for file in &mut self.files {
file.check()?;
+2 -1
View File
@@ -624,7 +624,8 @@ impl PinnedFile {
) -> Result<Self> {
Self::open_impl(path, directory, readers, writers, write, false)
}
pub(crate) fn open_read_shared(
/// Pin and check the object without opening a write-capable handle.
pub fn open_read_shared(
path: &Path,
directory: bool,
readers: &[String],