From 9487ad2ef9c7b67511e04bb6b9c31f30fdc3e87c Mon Sep 17 00:00:00 2001 From: Vincent Douillet Date: Thu, 21 Sep 2023 15:12:44 +0200 Subject: add unveil --- main.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/main.c b/main.c index 4ad1bf6..a9a9c5c 100644 --- a/main.c +++ b/main.c @@ -65,6 +65,8 @@ main(void) kcgi_strerror(parse_err)); /* A bit of security cannot hurt */ + if (-1 == unveil(DATA_DIR, "r") || -1 == unveil(NULL, NULL)) + http_exit(&r, KHTTP_500, "Unveil failed: %s", strerror(errno)); if (-1 == pledge("stdio rpath wpath cpath", NULL)) http_exit(&r, KHTTP_500, "Pledge failed: %s", strerror(errno)); -- cgit v1.2.3