From bab78d962ac6f3d878e4e9c17cb111bff11a1b6d Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 26 Mar 2026 22:36:44 +0000 Subject: cleanup Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/string.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) (limited to 'util/libreboot-utils/lib/string.c') diff --git a/util/libreboot-utils/lib/string.c b/util/libreboot-utils/lib/string.c index b639f0a4..c6e09752 100644 --- a/util/libreboot-utils/lib/string.c +++ b/util/libreboot-utils/lib/string.c @@ -321,15 +321,28 @@ lbgetprogname(char *argv0) return progname; } +int +xpledgex(const char *promises, const char *execpromises) +{ + int saved_errno = errno; + (void) promises, (void) execpromises, (void) saved_errno; +#ifdef __OpenBSD__ + if (pledge(promises, execpromises) == -1) + err_no_cleanup(0, errno, "pledge"); +#endif + errno = saved_errno; + return 0; +} - - - - - - - - - - - +int +xunveilx(const char *path, const char *permissions) +{ + int saved_errno = errno; + (void) path, (void) permissions, (void) saved_errno; +#ifdef __OpenBSD__ + if (pledge(promises, execpromises) == -1) + err_no_cleanup(0, errno, "pledge"); +#endif + errno = saved_errno; + return 0; +} -- cgit v1.2.1