util/nvmutil: add flock to pledge promises

otherwise, gbe.bin locking won't work!

Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
Leah Rowe
2026-03-14 23:59:56 +00:00
parent 46bbb4d8e4
commit 4b69645c88
+5 -5
View File
@@ -705,12 +705,12 @@ main(int argc, char *argv[])
#ifdef NVMUTIL_PLEDGE #ifdef NVMUTIL_PLEDGE
#ifdef NVMUTIL_UNVEIL #ifdef NVMUTIL_UNVEIL
if (pledge("stdio rpath wpath unveil", NULL) == -1) if (pledge("stdio flock rpath wpath unveil", NULL) == -1)
err(errno, "pledge"); err(errno, "pledge");
if (unveil("/dev/null", "r") == -1) if (unveil("/dev/null", "r") == -1)
err(errno, "unveil /dev/null"); err(errno, "unveil /dev/null");
#else #else
if (pledge("stdio rpath wpath", NULL) == -1) if (pledge("stdio flock rpath wpath", NULL) == -1)
err(errno, "pledge"); err(errno, "pledge");
#endif #endif
#endif #endif
@@ -727,19 +727,19 @@ main(int argc, char *argv[])
err(errno, "%s: unveil ro", fname); err(errno, "%s: unveil ro", fname);
if (unveil(NULL, NULL) == -1) if (unveil(NULL, NULL) == -1)
err(errno, "unveil block (ro)"); err(errno, "unveil block (ro)");
if (pledge("stdio rpath", NULL) == -1) if (pledge("stdio flock rpath", NULL) == -1)
err(errno, "pledge ro (kill unveil)"); err(errno, "pledge ro (kill unveil)");
} else { } else {
if (unveil(fname, "rw") == -1) if (unveil(fname, "rw") == -1)
err(errno, "%s: unveil rw", fname); err(errno, "%s: unveil rw", fname);
if (unveil(NULL, NULL) == -1) if (unveil(NULL, NULL) == -1)
err(errno, "unveil block (rw)"); err(errno, "unveil block (rw)");
if (pledge("stdio rpath wpath", NULL) == -1) if (pledge("stdio flock rpath wpath", NULL) == -1)
err(errno, "pledge rw (kill unveil)"); err(errno, "pledge rw (kill unveil)");
} }
#else #else
if (command[cmd_index].flags == O_RDONLY) { if (command[cmd_index].flags == O_RDONLY) {
if (pledge("stdio rpath", NULL) == -1) if (pledge("stdio flock rpath", NULL) == -1)
err(errno, "pledge ro"); err(errno, "pledge ro");
} }
#endif #endif