From 105389458f5b187cec306ed3eb101337b9fcaaca Mon Sep 17 00:00:00 2001 From: Ayush A Sri <66489925+ayushdoesdev@users.noreply.github.com> Date: Sun, 8 Nov 2026 12:13:22 +0530 Subject: [PATCH 1/3] Fix Windows Clippy warnings in store permissions --- code/crates/unwreck-store/src/perms.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/crates/unwreck-store/src/perms.rs b/code/crates/unwreck-store/src/perms.rs index a669802..c9e9d81 100644 --- a/code/crates/unwreck-store/src/perms.rs +++ b/code/crates/unwreck-store/src/perms.rs @@ -6,7 +6,9 @@ use std::path::Path; #[cfg(unix)] use std::os::unix::fs::{OpenOptionsExt, PermissionsExt}; +#[cfg(unix)] const DIR_MODE: u32 = 0o700; +#[cfg(unix)] const FILE_MODE: u32 = 0o600; pub(crate) fn ensure_private_dir(p: &Path) -> io::Result<()> { @@ -68,7 +70,7 @@ pub fn permission_warnings(root: &Path) -> Vec { #[cfg(not(unix))] { let _ = root; - return Vec::new(); + Vec::new() } #[cfg(unix)] { From 51d6af9c6ad8085763c78a8c67da9c05e4a043ce Mon Sep 17 00:00:00 2001 From: Ayush A Sri <66489925+ayushdoesdev@users.noreply.github.com> Date: Sun, 8 Nov 2026 12:16:56 +0530 Subject: [PATCH 2/3] Fix Windows Clippy warning in restore permissions --- code/crates/unwreck-restore/src/io.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/code/crates/unwreck-restore/src/io.rs b/code/crates/unwreck-restore/src/io.rs index 6cdd49c..1eb0c76 100644 --- a/code/crates/unwreck-restore/src/io.rs +++ b/code/crates/unwreck-restore/src/io.rs @@ -61,6 +61,8 @@ pub(crate) fn make_writable(p: &Path) { { let mut perm = meta.permissions(); if perm.readonly() { + // On Windows, clearing the read-only attribute is the supported way to make the file writable. + #[allow(clippy::permissions_set_readonly_false)] perm.set_readonly(false); let _ = fs::set_permissions(p, perm); } From 0eb640e1f29f6866f39aa4b97d37964c7edaa715 Mon Sep 17 00:00:00 2001 From: Ayush A Sri <66489925+ayushdoesdev@users.noreply.github.com> Date: Sun, 8 Nov 2026 12:23:37 +0530 Subject: [PATCH 3/3] Fix Windows sync of loose store objects --- code/crates/unwreck-store/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/code/crates/unwreck-store/src/lib.rs b/code/crates/unwreck-store/src/lib.rs index c4e94dc..720ec8b 100644 --- a/code/crates/unwreck-store/src/lib.rs +++ b/code/crates/unwreck-store/src/lib.rs @@ -340,7 +340,8 @@ impl Store { } let mut dirs = HashSet::new(); for (tmp, dest, h) in batch.loose { - File::open(&tmp)?.sync_all()?; + // Windows requires a write-capable handle for FlushFileBuffers (sync_all). + fs::OpenOptions::new().write(true).open(&tmp)?.sync_all()?; let parent = dest.parent().expect("object has parent").to_path_buf(); ensure_private_dir(&parent)?; fs::rename(&tmp, &dest)?;