mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-18 14:12:44 +02:00
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 <leah@libreboot.org>
This commit is contained in:
@@ -704,7 +704,17 @@ main(int argc, char *argv[])
|
|||||||
|
|
||||||
fname = argv[1];
|
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);
|
tname = new_tmpfile(&tmp_fd, 0, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (tname == NULL)
|
if (tname == NULL)
|
||||||
err(errno, "Can't create tmpfile");
|
err(errno, "Can't create tmpfile");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user