unveil x the vhosts directories

This commit is contained in:
Omar Polo 2021-01-25 15:02:55 +00:00
parent 2d3cc76f6d
commit 1078229283
1 changed files with 8 additions and 1 deletions

9
ex.c
View File

@ -262,7 +262,14 @@ executor_main(int fd)
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 (;;) {