Browse Source

fix windows build

remotes/origin/fix-insecure-world-writable-dir
Gal Schlezinger 8 months ago
parent
commit
d3aa611a38
  1. 11
      src/commands/env.rs

11
src/commands/env.rs

@ -35,17 +35,16 @@ fn generate_symlink_path() -> String { @@ -35,17 +35,16 @@ fn generate_symlink_path() -> String {
}
fn make_symlink(config: &FnmConfig) -> Result<std::path::PathBuf, Error> {
let base_dir = if cfg!(windows) {
config.multishell_storage().ensure_exists_silently()
} else {
config
#[cfg(windows)]
let base_dir = { config.multishell_storage().ensure_exists_silently() };
#[cfg(not(windows))]
let base_dir = config
.multishell_storage()
.ensure_exists_silently_with_permissions(|permissions| {
use std::os::unix::fs::PermissionsExt;
// r/w only for owner
permissions.set_mode(0o700);
})
};
});
let mut temp_dir = base_dir.join(generate_symlink_path());

Loading…
Cancel
Save