Browse Source

Call unveil() from srv_open() if on OpenBSD.

default 3 years ago
parent
commit
484cfbc800
1 changed files with 6 additions and 0 deletions
  1. 6 0
      data.c

+ 6 - 0
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;
 }