mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-18 04:22:15 +02:00
util/nvmutil: split unveil handling
urandom in main. this is because i'm going to further harden the use of pledge and unveil in a future patch, and this is a prerequisite. Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -89,6 +89,7 @@ main(int argc, char *argv[])
|
|||||||
checkdir("/dev/urandom");
|
checkdir("/dev/urandom");
|
||||||
checkdir(fname);
|
checkdir(fname);
|
||||||
#ifdef __OpenBSD__
|
#ifdef __OpenBSD__
|
||||||
|
err_if(unveil("/dev/urandom", "r") == -1);
|
||||||
block_unveil();
|
block_unveil();
|
||||||
#endif
|
#endif
|
||||||
openFiles(fname);
|
openFiles(fname);
|
||||||
@@ -446,8 +447,6 @@ swap(int partnum)
|
|||||||
void
|
void
|
||||||
block_unveil(void)
|
block_unveil(void)
|
||||||
{
|
{
|
||||||
err_if(unveil("/dev/urandom", "r") == -1);
|
|
||||||
|
|
||||||
if (flags == O_RDONLY) {
|
if (flags == O_RDONLY) {
|
||||||
err_if(unveil(fname, "r") == -1);
|
err_if(unveil(fname, "r") == -1);
|
||||||
err_if(unveil(NULL, NULL) == -1);
|
err_if(unveil(NULL, NULL) == -1);
|
||||||
|
|||||||
Reference in New Issue
Block a user