1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-25 14:22:37 +03:00

allow skipping mux permission check

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: https://github.com/wez/wezterm/issues/33
This commit is contained in:
Wez Furlong 2019-06-12 07:39:28 -07:00
parent a2b52eb777
commit b31e9ecb56

View File

@ -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()?;
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
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
);
}
}
}