summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib
diff options
context:
space:
mode:
authorLeah Rowe <leah@libreboot.org>2026-03-26 22:36:44 +0000
committerLeah Rowe <leah@libreboot.org>2026-03-26 22:43:14 +0000
commitbab78d962ac6f3d878e4e9c17cb111bff11a1b6d (patch)
tree9d699dd463a62a3519a8eaadd34f9b95ebfe6f2b /util/libreboot-utils/lib
parent1a09efbbbeda9caca912f4d07edc7b309c1dc6f4 (diff)
cleanup
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'util/libreboot-utils/lib')
-rw-r--r--util/libreboot-utils/lib/string.c35
1 files changed, 24 insertions, 11 deletions
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;
+}