summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-14 17:40:31 +0100
committerdefault <nobody@localhost>2022-11-14 17:40:31 +0100
commit484cfbc800121c7961f94c98149a2f8abbd27501 (patch)
treee4c7831b56067bfde67428b46b9ff98e76be0654 /data.c
parent01b2d3c66d638d0f291de15f1e2857ed4c1eedb7 (diff)
Call unveil() from srv_open() if on OpenBSD.
Diffstat (limited to 'data.c')
-rw-r--r--data.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/data.c b/data.c
index cb55415..88dceae 100644
--- a/data.c
+++ b/data.c
@@ -79,6 +79,12 @@ int srv_open(char *basedir)
if (error != NULL)
srv_log(error);
+#ifdef __OpenBSD__
+ srv_debug(2, xs_fmt("Calling unveil()"));
+ unveil(basedir, "rwc");
+ unveil(NULL, NULL);
+#endif /* __OpenBSD__ */
+
return ret;
}