commit - 2d3cc76f6d5c2eb4a23f0dbebe5ef779f07b947b
commit + 10782292833e092d37935a2c8b9e8e00bb88925d
blob - 6b4d42c449fef83f35d7abae8a524b65a0315ff4
blob + 15050b5bc0b1a3cb5220cbbf476c2502646f0c60
--- ex.c
+++ ex.c
int d;
#ifdef __OpenBSD__
- pledge("stdio sendfd proc exec", NULL);
+ for (vhost = hosts; vhost->domain != NULL; ++vhost) {
+ if (unveil(vhost->dir, "x") == -1)
+ err(1, "unveil %s for domain %s",
+ vhost->dir, vhost->domain);
+ }
+
+ if (pledge("stdio sendfd proc exec", NULL))
+ err(1, "pledge");
#endif
for (;;) {