summaryrefslogtreecommitdiffstats
path: root/tmux.c
diff options
context:
space:
mode:
authornicm <nicm>2020-03-12 09:26:34 +0000
committernicm <nicm>2020-03-12 09:26:34 +0000
commit2a5702a936829c30b1c427028fdb75a21e2e6771 (patch)
tree5aabc5e49ec6339679156bb7dd56bac6e9f3ed2a /tmux.c
parent4eba98313c6f1ddf1070bea8aaf638e8ea455231 (diff)
When the server socket is given by the user with -S, create it with
umask 177 instead of 117 because it may not be in a safe directory like the default directory in /tmp. The user can chmod it more open after it is created if they want.
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/tmux.c b/tmux.c
index 6572ad4e..572e705c 100644
--- a/tmux.c
+++ b/tmux.c
@@ -379,12 +379,15 @@ main(int argc, char **argv)
path[strcspn(path, ",")] = '\0';
}
}
- if (path == NULL && (path = make_label(label, &cause)) == NULL) {
- if (cause != NULL) {
- fprintf(stderr, "%s\n", cause);
- free(cause);
+ if (path == NULL) {
+ if ((path = make_label(label, &cause)) == NULL) {
+ if (cause != NULL) {
+ fprintf(stderr, "%s\n", cause);
+ free(cause);
+ }
+ exit(1);
}
- exit(1);
+ flags |= CLIENT_DEFAULTSOCKET;
}
socket_path = path;
free(label);