diff --git a/tmux.c b/tmux.c index d8985159..38ffa05c 100644 --- a/tmux.c +++ b/tmux.c @@ -226,7 +226,7 @@ make_label(const char *label, char **cause) xasprintf(cause, "%s is not a directory", base); goto fail; } - if (sb.st_uid != uid || (sb.st_mode & S_IRWXO) != 0) { + if (sb.st_uid != uid || (sb.st_mode & TMUX_SOCK_PERM) != 0) { xasprintf(cause, "directory %s has unsafe permissions", base); goto fail; } diff --git a/tmux.h b/tmux.h index 5e86dac9..3cd882a3 100644 --- a/tmux.h +++ b/tmux.h @@ -78,6 +78,9 @@ struct winlink; #ifndef TMUX_SOCK #define TMUX_SOCK "$TMUX_TMPDIR:" _PATH_TMP #endif +#ifndef TMUX_SOCK_PERM +#define TMUX_SOCK_PERM (7 /* o+rwx */) +#endif #ifndef TMUX_TERM #define TMUX_TERM "screen" #endif