summaryrefslogtreecommitdiff
path: root/util/libreboot-utils/lib
diff options
context:
space:
mode:
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;
+}