From 422e835ad33a11dbff86b7f526b591a191c8c407 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Thu, 23 Sep 2021 22:23:27 -0400 Subject: Make up build away from FreeBSD --- www/temp.causal.agency/Makefile | 5 ++--- www/temp.causal.agency/up.c | 7 ++++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/www/temp.causal.agency/Makefile b/www/temp.causal.agency/Makefile index 3e908305..cdcfb644 100644 --- a/www/temp.causal.agency/Makefile +++ b/www/temp.causal.agency/Makefile @@ -1,8 +1,7 @@ WEBROOT = /usr/local/www/temp.causal.agency -CFLAGS += -std=c11 -Wall -Wextra -Wpedantic -I/usr/local/include -LDFLAGS += -static -L/usr/local/lib -LDLIBS = -lkcgihtml -lkcgi -lz -lmd +CFLAGS += -std=c11 -Wall -Wextra -Wpedantic $$(pkg-config --cflags kcgi) +LDLIBS = -static $$(pkg-config --static --libs kcgi-html) up: diff --git a/www/temp.causal.agency/up.c b/www/temp.causal.agency/up.c index 3a2c08b6..5fdf6824 100644 --- a/www/temp.causal.agency/up.c +++ b/www/temp.causal.agency/up.c @@ -21,12 +21,15 @@ #include #include #include -#include #include #include #include #include +#ifdef __FreeBSD__ +#include +#endif + #include #include @@ -137,6 +140,7 @@ static void sandbox(void) { cwd = open(".", O_DIRECTORY); if (cwd < 0) err(EX_CONFIG, "."); +#ifdef __FreeBSD__ int error = cap_enter(); if (error) err(EX_OSERR, "cap_enter"); @@ -144,6 +148,7 @@ static void sandbox(void) { cap_rights_init(&rights, CAP_LOOKUP, CAP_CREATE, CAP_PWRITE); error = cap_rights_limit(cwd, &rights); if (error) err(EX_OSERR, "cap_rights_limit"); +#endif } int main(void) { -- cgit 1.4.1