1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 16:42:56 -08:00

pcidump(8) only opens devices in O_RDONLY from /dev, and additionally writes a

`romfile' if -r is used, but since I'm only unveiling after that file is
actually opened there's no need to unveil it as well.

OK deraadt@ kn@
This commit is contained in:
mestre 2019-11-30 14:02:29 +00:00
parent 083d4b5c5a
commit c8d17636e0

View File

@ -1,4 +1,4 @@
/* $OpenBSD: pcidump.c,v 1.55 2019/06/28 13:32:49 deraadt Exp $ */
/* $OpenBSD: pcidump.c,v 1.56 2019/11/30 14:02:29 mestre Exp $ */
/*
* Copyright (c) 2006, 2007 David Gwynne <loki@animata.net>
@ -188,6 +188,11 @@ main(int argc, char *argv[])
err(1, "%s", romfile);
}
if (unveil("/dev", "r") == -1)
err(1, "unveil");
if (unveil(NULL, NULL) == -1)
err(1, "unveil");
if (hex > 1)
size = 256;
if (hex > 2)