Skip to content

Commit

Permalink
allow skipping mux permission check
Browse files Browse the repository at this point in the history
When using WSL, we want to place the unix socket on NTFS and that
reports an insecure set of permissions which cause us to refuse
to start up.

As a bit of a gross hack, allow skipping that check by setting an
environmental variable:

```
WEZTERM_SKIP_MUX_SOCK_PERMISSIONS_CHECK= wezterm start --front-end muxserver
```

that works best in conjunction with this in the WSL `.wezterm.toml`
file: (swap `wez` with your username):

```
mux_server_unix_domain_socket_path = "/mnt/c/Users/wez/.local/share/wezterm/sock"
```

refs: #33
  • Loading branch information
wez committed Jun 12, 2019
1 parent a2b52eb commit b31e9ec
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/server/listener.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,17 +331,19 @@ fn safely_create_sock_path(sock_path: &str) -> Result<UnixListener, Error> {

#[cfg(unix)]
{
// Let's be sure that the ownership looks sane
let meta = sock_dir.symlink_metadata()?;

let permissions = meta.permissions();
if (permissions.mode() & 0o22) != 0 {
bail!(
"The permissions for {} are insecure and currently
if !std::env::var_os("WEZTERM_SKIP_MUX_SOCK_PERMISSIONS_CHECK").is_some() {
// Let's be sure that the ownership looks sane
let meta = sock_dir.symlink_metadata()?;

let permissions = meta.permissions();
if (permissions.mode() & 0o22) != 0 {
bail!(
"The permissions for {} are insecure and currently
allow other users to write to it (permissions={:?})",
sock_dir.display(),
permissions
);
sock_dir.display(),
permissions
);
}
}
}

Expand Down

0 comments on commit b31e9ec

Please sign in to comment.