summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2015-10-17 20:16:12 +0100
committerNicholas Marriott <nicholas.marriott@gmail.com>2015-10-17 20:16:12 +0100
commit6c3ade76dfae9d9fe6f838a11dd23cd7109505de (patch)
tree71ff901f3f17f55b25d4b21ed258164df6ca8b7b
parent487285b325fff085e78d1132e99b2d39bfa22897 (diff)
__OpenBSD__ around pledge().
-rw-r--r--client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/client.c b/client.c
index 612d4202..1e7492d9 100644
--- a/client.c
+++ b/client.c
@@ -276,6 +276,7 @@ client_main(struct event_base *base, int argc, char **argv, int flags)
if ((ttynam = ttyname(STDIN_FILENO)) == NULL)
ttynam = "";
+#ifdef __OpenBSD__
/*
* Drop privileges for client. "proc exec" is needed for -c and for
* locking (which uses system(3)).
@@ -287,6 +288,7 @@ client_main(struct event_base *base, int argc, char **argv, int flags)
*/
if (pledge("stdio unix sendfd proc exec tty", NULL) != 0)
fatal("pledge failed");
+#endif
/* Free stuff that is not used in the client. */
options_free(&global_options);
@@ -605,6 +607,7 @@ client_dispatch_wait(void)
struct msg_stdout_data stdoutdata;
struct msg_stderr_data stderrdata;
int retval;
+#ifdef __OpenBSD__
static int pledge_applied;
/*
@@ -618,6 +621,7 @@ client_dispatch_wait(void)
fatal("pledge failed");
pledge_applied = 1;
};
+#endif
for (;;) {
if ((n = imsg_get(&client_ibuf, &imsg)) == -1)