summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-09-30 02:35:03 +0000
committerJune McEnroe <june@causal.agency>2021-09-30 02:38:53 +0000
commit89d36ea5d5a28c68cca239024df7b94e3a558349 (patch)
treeb89c440267d8f4f3ade33661ae76c0318515f40e
parentRemove link to gopher (diff)
downloadsrc-89d36ea5d5a28c68cca239024df7b94e3a558349.tar.gz
src-89d36ea5d5a28c68cca239024df7b94e3a558349.zip
pledge(2) hilex
-rw-r--r--bin/hilex.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/bin/hilex.c b/bin/hilex.c
index 8a06eb36..2289ef95 100644
--- a/bin/hilex.c
+++ b/bin/hilex.c
@@ -149,6 +149,11 @@ static void ansiHeader(const char *opts[]) {
 	close(rw[0]);
 	close(rw[1]);
 	setlinebuf(stdout);
+
+#ifdef __OpenBSD__
+	error = pledge("stdio", NULL);
+	if (error) err(EX_OSERR, "pledge");
+#endif
 }
 
 static void ansiFooter(const char *opts[]) {
@@ -369,6 +374,16 @@ int main(int argc, char *argv[]) {
 		pager = isatty(STDOUT_FILENO);
 	}
 
+#ifdef __OpenBSD__
+	int error;
+	if (formatter->header == ansiHeader && pager) {
+		error = pledge("stdio proc exec", NULL);
+	} else {
+		error = pledge("stdio", NULL);
+	}
+	if (error) err(EX_OSERR, "pledge");
+#endif
+
 	if (!name) {
 		if (NULL != (name = strrchr(path, '/'))) {
 			name++;
/src/commit/www/git.causal.agency/cgit/tests/t0111-filter.sh?id=8a10aa570d084f3f417b24f37bf547ac92de611d&follow=1'>Remove Lua supportJune McEnroe Lua support is unused and the dlsym fwrite/write hacks horrify me. Clean it up. 2021-01-20Fix tests for diff spansJune McEnroe 2021-01-20Avoid matching ':' in make tagsJune McEnroe Otherwise a :: rule includes one of the ':'s in the tag name. 2021-01-19Prefer tag matches not preceded by [[:alnum:]]June McEnroe Otherwise the "id" in "void" matches for "void id". 2021-01-19Escape \ and / in mtags search patternsJune McEnroe 2021-01-20Use mtags in source-filterJune McEnroe 2021-01-19Add mtags to generate tags for make and mdocJune McEnroe 2021-01-19Map tags to IDs using only [[:alnum:]-._]June McEnroe 2021-01-19Don't use a pager if reading standard inputJune McEnroe 2021-01-19Support BSD make syntax and match *.amJune McEnroe These don't really go together, but... 2021-01-19Match tab following escaped newline in make assignmentsJune McEnroe Otherwise it ends up going into Shell state. 2021-01-18Allow matching lexers using first input lineJune McEnroe