aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kike.c6
-rw-r--r--zyklonb.c6
2 files changed, 12 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);
diff --git a/zyklonb.c b/zyklonb.c
index 4ab27bc..c7ab8c7 100644
--- a/zyklonb.c
+++ b/zyklonb.c
@@ -2023,6 +2023,12 @@ main (int argc, char *argv[])
ctx.signal_event.user_data = &ctx;
poller_fd_set (&ctx.signal_event, POLLIN);
+#if OpenBSD >= 201605
+ // cpath is for creating the plugin home directory
+ if (pledge ("stdio rpath cpath inet proc exec", NULL))
+ exit_fatal ("%s: %s", "pledge", strerror (errno));
+#endif
+
plugin_load_all_from_config (&ctx);
if (!parse_config (&ctx, &e)
|| !irc_connect (&ctx, &e))