3 #if defined(__FreeBSD__)
5 #include <sys/capsicum.h>
14 for (h = hosts; h->domain != NULL; ++h)
19 LOGW(NULL, "disabling sandbox because CGI scripts are enabled");
23 if (cap_enter() == -1)
27 #elif defined(__linux__)
35 #elif defined(__OpenBSD__)
46 for (h = hosts; h->domain != NULL; ++h) {
47 if (unveil(h->dir, "rx") == -1)
48 err(1, "unveil %s for domain %s", h->dir, h->domain);
54 if (pledge("stdio rpath inet proc exec", NULL) == -1)
57 /* drop proc and exec if cgi isn't enabled */
59 if (pledge("stdio rpath inet", NULL) == -1)
68 LOGN(NULL, "%s", "no sandbox method known for this OS");