diff options
author | nicm <nicm> | 2015-10-23 16:07:29 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-10-23 16:07:29 +0000 |
commit | 5383b047d1dd0d71f724d8f9cac4e45994506d35 (patch) | |
tree | 823f3a2854f5159c0cece2e7bee8ca970c6951cf /tmux.c | |
parent | 14da99940806dd63c2180ad238886fcb6735db04 (diff) | |
download | rtmux-5383b047d1dd0d71f724d8f9cac4e45994506d35.tar.gz rtmux-5383b047d1dd0d71f724d8f9cac4e45994506d35.tar.bz2 rtmux-5383b047d1dd0d71f724d8f9cac4e45994506d35.zip |
tmux can call pledge() in main with large set and then reduce it
slightly in the server to "stdio rpath wpath cpath fattr unix recvfd
proc exec tty ps".
Diffstat (limited to 'tmux.c')
-rw-r--r-- | tmux.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -19,6 +19,7 @@ #include <sys/types.h> #include <sys/stat.h> +#include <err.h> #include <errno.h> #include <event.h> #include <fcntl.h> @@ -254,6 +255,10 @@ main(int argc, char **argv) if (shell_cmd != NULL && argc != 0) usage(); + if (pledge("stdio rpath wpath cpath flock fattr unix sendfd recvfd " + "proc exec tty ps", NULL) != 0) + err(1, "pledge"); + if (!(flags & CLIENT_UTF8)) { /* * If the user has set whichever of LC_ALL, LC_CTYPE or LANG |