From 9087339caef73478e0156fd996c5c55c52a48dcc Mon Sep 17 00:00:00 2001 From: "Peter H. Froehlich" Date: Sun, 17 Oct 2021 06:41:36 -0400 Subject: OpenBSD "port" of sorts, Makefile is almost completely new --- mkgpt.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'mkgpt.c') diff --git a/mkgpt.c b/mkgpt.c index ae71032..885aac3 100644 --- a/mkgpt.c +++ b/mkgpt.c @@ -33,6 +33,7 @@ #include #include #include +#include struct partition { GUID type; @@ -95,6 +96,14 @@ static int secondary_gpt_sect; int main(int argc, char *argv[]) { +#if defined(__OpenBSD__) + if (pledge("stdio cpath rpath wpath", NULL) != 0) { + fprintf(stderr, "failed to pledge\n"); + exit(EXIT_FAILURE); + } + /* TODO call unveil on each path AHEAD of using it? */ +#endif + random_guid(&disk_guid); if (parse_opts(argc, argv) != 0) { -- cgit 1.4.1-2-gfad0