From 7930cb54c0cd6105899ba51be767697e1210aec2 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sun, 25 Oct 2015 09:31:46 +0000 Subject: [PATCH] ifdef __OpenBSD__ around pledge(). --- server.c | 2 ++ tmux.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/server.c b/server.c index 139505d4..d3be5cc1 100644 --- a/server.c +++ b/server.c @@ -177,9 +177,11 @@ server_start(struct event_base *base, int lockfd, char *lockfile) } close(pair[0]); +#ifdef __OpenBSD__ if (pledge("stdio rpath wpath cpath fattr unix recvfd proc exec tty " "ps", NULL) != 0) fatal("pledge failed"); +#endif /* * Must daemonise before loading configuration as the PID changes so diff --git a/tmux.c b/tmux.c index b8373ab7..18da1abe 100644 --- a/tmux.c +++ b/tmux.c @@ -259,9 +259,11 @@ main(int argc, char **argv) if (shell_cmd != NULL && argc != 0) usage(); +#ifdef __OpenBSD__ if (pledge("stdio rpath wpath cpath flock fattr unix sendfd recvfd " "proc exec tty ps", NULL) != 0) err(1, "pledge"); +#endif if (!(flags & CLIENT_UTF8)) { /*