aboutsummaryrefslogtreecommitdiff
path: root/xtask/src/main.rs
diff options
context:
space:
mode:
authorValentin Popov <valentin@popov.link>2026-07-18 04:22:20 +0300
committerValentin Popov <valentin@popov.link>2026-07-18 04:22:20 +0300
commit9f7a94b0d90756a171b77c50d070a3e24cf1cb64 (patch)
tree8330d9d6f06dab02ddd027a36b029a05e8023559 /xtask/src/main.rs
parent337894528c3afd55826b3b766a3afa6c076ba5fa (diff)
downloadfparkan-9f7a94b0d90756a171b77c50d070a3e24cf1cb64.tar.xz
fparkan-9f7a94b0d90756a171b77c50d070a3e24cf1cb64.zip
fix(policy): normalize Windows FFI paths
Diffstat (limited to 'xtask/src/main.rs')
-rw-r--r--xtask/src/main.rs9
1 files changed, 8 insertions, 1 deletions
diff --git a/xtask/src/main.rs b/xtask/src/main.rs
index 894c95e..e15d6ae 100644
--- a/xtask/src/main.rs
+++ b/xtask/src/main.rs
@@ -1563,7 +1563,7 @@ const AUDITED_UNSAFE_SOURCE_FILES: &[&str] = &[
];
fn is_audited_unsafe_source(path: &Path) -> bool {
- let as_path = path.as_os_str().to_string_lossy();
+ let as_path = path.as_os_str().to_string_lossy().replace('\\', "/");
AUDITED_UNSAFE_SOURCE_FILES
.iter()
.any(|candidate| as_path.ends_with(candidate))
@@ -3739,4 +3739,11 @@ source = "git+https://example.invalid/repo"
)]
);
}
+
+ #[test]
+ fn audited_unsafe_allowlist_accepts_windows_separators() {
+ let path = Path::new(r".\adapters\fparkan-render-vulkan\src\ffi\runtime.rs");
+
+ assert!(is_audited_unsafe_source(path));
+ }
}