Skip to content

Commit ed993d5

Browse files
committed
Fix permission sisue
1 parent 9d573aa commit ed993d5

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

crates/vespera_macro/src/collector.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,18 @@ pub fn get_users() -> String {
651651
let permissions = fs::Permissions::from_mode(0o000);
652652
fs::set_permissions(&file_path, permissions).expect("Failed to set permissions");
653653

654+
// Verify permissions actually took effect (they don't on WSL with Windows filesystem)
655+
// If we can still read the file, skip this test
656+
if fs::read_to_string(&file_path).is_ok() {
657+
// Restore permissions for cleanup
658+
let permissions = fs::Permissions::from_mode(0o644);
659+
fs::set_permissions(&file_path, permissions).ok();
660+
eprintln!(
661+
"Skipping test: filesystem doesn't respect Unix permissions (likely WSL with NTFS)"
662+
);
663+
return;
664+
}
665+
654666
// Attempt to collect metadata - should fail with "failed to read route file" error
655667
let result = collect_metadata(temp_dir.path(), folder_name);
656668

0 commit comments

Comments
 (0)