summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-28 05:48:45 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-28 05:49:41 +0000
commit55f0e6ac8e540cea24af64070bfc49a032729511 (patch)
treef2c790e11cf9e05dfc079958b192636c40799085 /util/libreboot-utils/lib
parent7f39ce5f9b635444e06302fbe556709e84bf3b9a (diff)
libreboot-utils: simplified pledge/unveil usage
i no longer care about openbsd 5.9. we assume unveil is available, as has been the case for the past 12 years. i use wrappers for unveil and pledge, which means that i call them on every os. on OSes that don't have these, i just return. it's somewhat inelegant, but also means that i see errors more easily, e.g. misnamed variables inside previous ifdef OpenBSD blocks. Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib')
-rw-r--r--util/libreboot-utils/lib/string.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/util/libreboot-utils/lib/string.c b/util/libreboot-utils/lib/string.c
index 986c7b8e..dd11c039 100644
--- a/util/libreboot-utils/lib/string.c
+++ b/util/libreboot-utils/lib/string.c
@@ -294,12 +294,6 @@ err_no_cleanup(int stfu, int nvm_errval, const char *msg, ...)
int saved_errno = errno;
const char *p;
-#if defined(__OpenBSD__) && defined(OpenBSD)
-#if (OpenBSD) >= 509
- if (pledge("stdio", NULL) == -1)
- fprintf(stderr, "pledge failure during exit");
-#endif
-#endif
if (!errno)
saved_errno = errno = ECANCELED;
@@ -363,6 +357,8 @@ lbgetprogname(char *argv0)
return progname;
}
+/* https://man.openbsd.org/pledge.2
+ https://man.openbsd.org/unveil.2 */
int
xpledgex(const char *promises, const char *execpromises)
{
@@ -375,7 +371,6 @@ xpledgex(const char *promises, const char *execpromises)
errno = saved_errno;
return 0;
}
-
int
xunveilx(const char *path, const char *permissions)
{