diff --git a/.github/workflows/wasi.yml b/.github/workflows/wasi.yml index c69414ccc08..7597fa92782 100644 --- a/.github/workflows/wasi.yml +++ b/.github/workflows/wasi.yml @@ -37,7 +37,7 @@ jobs: CARGO_TARGET_WASM32_WASIP1_RUNNER: wasmtime run: | # Get all utilities and exclude ones that don't compile for wasm32-wasip1 - EXCLUDE="df|du|env|expr|mktemp|more|tac|test" + EXCLUDE="df|du|env|expr|more|tac|test" UTILS=$(./util/show-utils.sh | tr ' ' '\n' | grep -vE "^($EXCLUDE)$" | sed 's/^/-p uu_/' | tr '\n' ' ') cargo test --target wasm32-wasip1 --no-default-features $UTILS - name: Run integration tests via wasmtime diff --git a/Cargo.toml b/Cargo.toml index a775c1e7ef7..00f2416a37a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -206,6 +206,7 @@ feat_wasm = [ "ln", "ls", "mkdir", + "mktemp", "mv", "nl", "nproc", diff --git a/src/uu/mktemp/src/mktemp.rs b/src/uu/mktemp/src/mktemp.rs index f0cd78cfe55..59448d86808 100644 --- a/src/uu/mktemp/src/mktemp.rs +++ b/src/uu/mktemp/src/mktemp.rs @@ -551,7 +551,7 @@ fn make_temp_dir(dir: &Path, prefix: &str, rand: usize, suffix: &str) -> UResult // The directory is created with these permission at creation time, using mkdir(3) syscall. // This is not relevant on Windows systems. See: https://docs.rs/tempfile/latest/tempfile/#security // `fs` is not imported on Windows anyways. - #[cfg(not(windows))] + #[cfg(unix)] builder.permissions(fs::Permissions::from_mode(0o700)); match builder.tempdir_in(dir) {