Skip to content

Commit 75cfee4

Browse files
committed
Implemented is_path_owned_by_current_user for wasi.
Not that it's doing very much when wasi doesn't have a concept of current user. This is part of trying to get this to build with wasi as a build target.
1 parent ab8880f commit 75cfee4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

gix-sec/src/identity.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,15 @@ pub fn is_path_owned_by_current_user(path: &Path) -> std::io::Result<bool> {
1717
impl_::is_path_owned_by_current_user(path)
1818
}
1919

20-
#[cfg(not(windows))]
20+
// Wasi doesn't have a concept of a user, so this is implicitly true.
21+
#[cfg(target_os = "wasi")]
22+
mod impl_ {
23+
pub fn is_path_owned_by_current_user(_path: &std::path::Path) -> std::io::Result<bool> {
24+
Ok(true)
25+
}
26+
}
27+
28+
#[cfg(all(not(windows), not(target_os = "wasi")))]
2129
mod impl_ {
2230
use std::path::Path;
2331

0 commit comments

Comments
 (0)