mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
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@
This commit is contained in:
parent
325cbe90d9
commit
fc118e13a9
2
server.c
2
server.c
@ -258,7 +258,7 @@ server_update_socket(void)
|
|||||||
|
|
||||||
if (stat(socket_path, &sb) != 0)
|
if (stat(socket_path, &sb) != 0)
|
||||||
return;
|
return;
|
||||||
mode = sb.st_mode;
|
mode = sb.st_mode & ACCESSPERMS;
|
||||||
if (n != 0) {
|
if (n != 0) {
|
||||||
if (mode & S_IRUSR)
|
if (mode & S_IRUSR)
|
||||||
mode |= S_IXUSR;
|
mode |= S_IXUSR;
|
||||||
|
Loading…
Reference in New Issue
Block a user