Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2024-10-02 14:01:10 +01:00
commit 8d2aee34ab
3 changed files with 5 additions and 2 deletions

View File

@ -823,7 +823,7 @@ const struct options_table_entry options_table[] = {
.type = OPTIONS_TABLE_STRING, .type = OPTIONS_TABLE_STRING,
.scope = OPTIONS_TABLE_SESSION, .scope = OPTIONS_TABLE_SESSION,
.flags = OPTIONS_TABLE_IS_ARRAY, .flags = OPTIONS_TABLE_IS_ARRAY,
.default_str = "DISPLAY KRB5CCNAME SSH_ASKPASS SSH_AUTH_SOCK " .default_str = "DISPLAY KRB5CCNAME MSYSTEM SSH_ASKPASS SSH_AUTH_SOCK "
"SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY", "SSH_AGENT_PID SSH_CONNECTION WINDOWID XAUTHORITY",
.text = "List of environment variables to update in the session " .text = "List of environment variables to update in the session "
"environment when a client is attached." "environment when a client is attached."

2
tmux.c
View File

@ -222,7 +222,7 @@ make_label(const char *label, char **cause)
xasprintf(cause, "%s is not a directory", base); xasprintf(cause, "%s is not a directory", base);
goto fail; 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); xasprintf(cause, "directory %s has unsafe permissions", base);
goto fail; goto fail;
} }

3
tmux.h
View File

@ -84,6 +84,9 @@ struct winlink;
#ifndef TMUX_SOCK #ifndef TMUX_SOCK
#define TMUX_SOCK "$TMUX_TMPDIR:" _PATH_TMP #define TMUX_SOCK "$TMUX_TMPDIR:" _PATH_TMP
#endif #endif
#ifndef TMUX_SOCK_PERM
#define TMUX_SOCK_PERM (7 /* o+rwx */)
#endif
#ifndef TMUX_TERM #ifndef TMUX_TERM
#define TMUX_TERM "screen" #define TMUX_TERM "screen"
#endif #endif