From 2dabafe69153724d986fc570970d4d54acd03fae Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Thu, 1 Jun 2023 08:40:01 +0100 Subject: util/nvmutil: move xpledge/xunveil to nvmutil.h They don't precisely *pertain* to nvmutil, but they are useful helper functions for calling pledge/unveil in OpenBSD. Ideally, the main file should only contain core logic pertaining to the execution of *nvmutil*. Put xpledge() and xunveil() in nvmutil.h. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'util/nvmutil/nvmutil.c') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index 0f974048..6b3020dc 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -292,23 +292,3 @@ next_part: err(ERR(), "%s", filename); xpledge("stdio", NULL); } - -void -xpledge(const char *promises, const char *execpromises) -{ - (void)promises; (void)execpromises; -#ifdef __OpenBSD__ - if (pledge(promises, execpromises) == -1) - err(ERR(), "pledge"); -#endif -} - -void -xunveil(const char *path, const char *permissions) -{ - (void)path; (void)permissions; -#ifdef __OpenBSD__ - if (unveil(path, permissions) == -1) - err(ERR(), "unveil"); -#endif -} -- cgit v1.2.1