From: git Date: Thu, 19 Mar 2026 21:45:39 +0000 (-0400) Subject: add OpenBSD pledge support X-Git-Url: https://git.datadissipation.net/?a=commitdiff_plain;h=7e9445ee739ca6030336d68c5356e91a47c8dbd8;p=ust.git add OpenBSD pledge support --- diff --git a/ust.c b/ust.c index 392bc43..8be0ce7 100644 --- a/ust.c +++ b/ust.c @@ -143,6 +143,13 @@ openport(void) int flags; struct flock fl = { 0 }; + #ifdef __OpenBSD__ + if (pledge("stdio rpath wpath tty flock", NULL) == -1) { + perror("pledge"); + die(1, "failed to set up pledge, exiting now\n"); + } + #endif + if (verbose) fprintf(stderr, "opening \"%s\"\n", line); fd = open(line, (O_RDWR | O_NOCTTY | O_NDELAY));