about summary refs log tree commit diff homepage
path: root/image.c
diff options
context:
space:
mode:
Diffstat (limited to 'image.c')
-rw-r--r--image.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/image.c b/image.c
index d8fcbc7..5e7fee7 100644
--- a/image.c
+++ b/image.c
@@ -204,11 +204,16 @@ static int streamWrite(void *cookie, const char *buf, int len) {
 
 static void worker(void) {
 	struct kfcgi *fcgi;
-	enum kcgi_err error = khttp_fcgi_init(
+	int error = khttp_fcgi_init(
 		&fcgi, Keys, KeysLen, Pages, PagesLen, PageTile
 	);
 	if (error) errkcgi(EX_CONFIG, error, "khttp_fcgi_init");
 
+#ifdef __OpenBSD__
+	error = pledge("stdio recvfd", NULL);
+	if (error) err(EX_OSERR, "pledge");
+#endif
+
 	for (;;) {
 		struct kreq req;
 		error = khttp_fcgi_parse(fcgi, &req);
@@ -276,6 +281,16 @@ int main(int argc, char *argv[]) {
 	fontLoad(fontPath);
 	tilesMap(dataPath);
 
+#ifdef __OpenBSD__
+	if (kcgi) {
+		int error = pledge("stdio unix sendfd recvfd proc", NULL);
+		if (error) err(EX_OSERR, "pledge");
+	} else {
+		int error = pledge("stdio", NULL);
+		if (error) err(EX_OSERR, "pledge");
+	}
+#endif
+
 #ifdef __FreeBSD__
 	int error = cap_enter();
 	if (error) err(EX_OSERR, "cap_enter");
bfcc316&follow=1'>Remove TOURJune McEnroe 2022-07-03Add The Bone Shard EmperorJune McEnroe 2022-06-25Bump xterm font size to 12June McEnroe 2022-06-10Handle subshells (and functions) inside substitutionsJune McEnroe 2022-06-10Switch to jorts Install scriptJune McEnroe 2022-06-08Indicate if still reading or no resultsJune McEnroe 2022-06-08Add Maiden, Mother, CroneJune McEnroe 2022-06-05FIRST SHOW IN 2.5 YEARS BABEY!!!June McEnroe 2022-06-03Set line number on File linesJune McEnroe 2022-06-03Stop polling stdin after EOFJune McEnroe 2022-06-02Set TABSIZE=4June McEnroe 2022-06-02Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe