summaryrefslogtreecommitdiff
path: root/kike.c
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-03-30 00:50:44 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-03-30 00:50:44 +0200
commit695d615225bbd66ffee42f5c073ed45327790512 (patch)
tree4ed00102d22e394418d7b985dacaf5feda63dbd7 /kike.c
parent8a3144f0acb7fd934826ccc478707e77bda097d7 (diff)
downloadxK-695d615225bbd66ffee42f5c073ed45327790512.tar.gz
xK-695d615225bbd66ffee42f5c073ed45327790512.tar.xz
xK-695d615225bbd66ffee42f5c073ed45327790512.zip
ZyklonB, kike: Use pledge(2) in OpenBSD
degesch has something like "stdio wpath cpath inet tty proc exec" but given that it's user-extensible and very annoying for users to have it crash, I'm leaving it unrestricted for now.
Diffstat (limited to 'kike.c')
-rw-r--r--kike.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kike.c b/kike.c
index ce5bc1f..deff370 100644
--- a/kike.c
+++ b/kike.c
@@ -4076,6 +4076,12 @@ main (int argc, char *argv[])
else if (!irc_lock_pid_file (&ctx, &e))
exit_fatal ("%s", e->message);
+#if OpenBSD >= 201605
+ // This won't be as simple once we decide to implement REHASH
+ if (pledge ("stdio inet dns", NULL))
+ exit_fatal ("%s: %s", "pledge", strerror (errno));
+#endif
+
ctx.polling = true;
while (ctx.polling)
poller_run (&ctx.poller);