commit 7ee4156793eb3f5f7f47528ab32721be4c507324
parent d3f300c5c3c5e5fc7019386e77d3b59635484309
Author: Jacob R. Edwards <jacobouno@protonmail.com>
Date: Wed, 23 Dec 2020 18:17:14 -0800
Add OpenBSD pledge(2)
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/main.c b/main.c
@@ -677,6 +677,11 @@ main(int argc, char *argv[])
{
int status;
+#ifdef __OpenBSD__
+ if (pledge("stdio rpath wpath cpath inet dns proc exec", NULL) == -1)
+ err(1, "pledge");
+#endif
+
if (mkdtemp(tmpdir) == NULL)
err(1, "mkdtemp '%s'", tmpdir);