From: semarie Date: Thu, 7 Jul 2016 09:24:09 +0000 (+0000) Subject: tmux: only consider ACCESSPERMS for setting mode on socket_path. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=d61e0664167b898ab00cf76b043f66f4fd3e1d83;p=openbsd 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@ --- 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 @@ -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;