summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/tmux.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2015-10-23 16:07:29 +0000
committernicm <nicm@openbsd.org>2015-10-23 16:07:29 +0000
commit4e7a7ade8c378113fb9de224a8f3c8aa1de4fdcd (patch)
tree6a6d2aa511473883db7b02d85ac9237d58568068 /usr.bin/tmux/tmux.c
parentFormat for scroll position, from Jorge Morante. (diff)
downloadwireguard-openbsd-4e7a7ade8c378113fb9de224a8f3c8aa1de4fdcd.tar.xz
wireguard-openbsd-4e7a7ade8c378113fb9de224a8f3c8aa1de4fdcd.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 'usr.bin/tmux/tmux.c')
-rw-r--r--usr.bin/tmux/tmux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/tmux/tmux.c b/usr.bin/tmux/tmux.c
index 91d28dab528..11fde3a0a91 100644
--- a/usr.bin/tmux/tmux.c
+++ b/usr.bin/tmux/tmux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.c,v 1.144 2015/09/14 12:12:24 nicm Exp $ */
+/* $OpenBSD: tmux.c,v 1.145 2015/10/23 16:07:29 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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