diff options
author | Sebastien Marie <semarie@cvs.openbsd.org> | 2016-07-07 09:24:10 +0000 |
---|---|---|
committer | Sebastien Marie <semarie@cvs.openbsd.org> | 2016-07-07 09:24:10 +0000 |
commit | 0f429a3e055bb483d898517ce1786569700b42e8 (patch) | |
tree | 06f6c9839919358614b6f493cb5d7a31a5377bc9 /usr.bin | |
parent | ad55acfb0d5e6fc50522aa2a181b940b72149933 (diff) |
tmux: only consider ACCESSPERMS for setting mode on socket_path.
it explicitly removes any S_ISUID|S_ISGID|S_ISTXT bits, instead of letting
pledge(2) silenciously remove them.
ok nicm@ beck@ deraadt@
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/server.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/server.c b/usr.bin/tmux/server.c index 953708be8ed..420f1644600 100644 --- a/usr.bin/tmux/server.c +++ b/usr.bin/tmux/server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server.c,v 1.158 2016/03/30 13:20:07 nicm Exp $ */ +/* $OpenBSD: server.c,v 1.159 2016/07/07 09:24:09 semarie Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com> @@ -258,7 +258,7 @@ server_update_socket(void) if (stat(socket_path, &sb) != 0) return; - mode = sb.st_mode; + mode = sb.st_mode & ACCESSPERMS; if (n != 0) { if (mode & S_IRUSR) mode |= S_IXUSR; |