diff options
author | Ricardo Mestre <mestre@cvs.openbsd.org> | 2019-11-30 14:02:30 +0000 |
---|---|---|
committer | Ricardo Mestre <mestre@cvs.openbsd.org> | 2019-11-30 14:02:30 +0000 |
commit | d4a7de6a1affd1eaf8ee443b753e11bfb376b8e7 (patch) | |
tree | bb8982ba5f60367d71e6dbead62065beca149f4a /usr.sbin | |
parent | 30d087a72727bd4d1ade0a8131aff6aa65b15610 (diff) |
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@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/pcidump/pcidump.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.sbin/pcidump/pcidump.c b/usr.sbin/pcidump/pcidump.c index 6f159bb9d6a..fd8034d9136 100644 --- a/usr.sbin/pcidump/pcidump.c +++ b/usr.sbin/pcidump/pcidump.c @@ -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) |