From e2d873415083fbddb965bece133090628cbab772 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Mon, 16 Mar 2026 14:56:11 +0000 Subject: util/nvmutil: use local tmpfile on openbsd if the global file is created on a different file system than the gbe file, unveil would trigger an abort trap, since we rely on created a second temporary file, whose path we can't know ahead of time. i could get rid of unveil, or unveil a directory, but neither is acceptable. just use localtmp on openbsd. a temporary file is created next to the gbe file, in the same directory. Signed-off-by: Leah Rowe --- util/nvmutil/nvmutil.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'util/nvmutil/nvmutil.c') diff --git a/util/nvmutil/nvmutil.c b/util/nvmutil/nvmutil.c index fbddcd3e..bab9ecfd 100644 --- a/util/nvmutil/nvmutil.c +++ b/util/nvmutil/nvmutil.c @@ -704,7 +704,17 @@ main(int argc, char *argv[]) fname = argv[1]; +#ifdef NVMUTIL_UNVEIL + /* + * if global tmp is a different filesystem, + * unveil would trap on final file rename + * and we can't know the path in advance + */ + tname = new_tmpfile(&tmp_fd, 1, NULL); +#else tname = new_tmpfile(&tmp_fd, 0, NULL); +#endif + if (tname == NULL) err(errno, "Can't create tmpfile"); -- cgit v1.2.1