Only a read-only file descriptor is required to implement list_devs()

and list_verbose(), so don't open /dev/pci read-write.  This allows
pciconf -l[v] to work for non-root users, assuming the securelevel is
0 or -1.

Problem experienced by:	William Michael Grim <wgrim@siue.edu>
This commit is contained in:
Robert Watson 2003-12-31 19:38:29 +00:00
parent 9eaf31e548
commit 6c72866dff
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=124031

View File

@ -165,7 +165,7 @@ list_devs(int verbose)
if (verbose)
load_vendors();
fd = open(_PATH_DEVPCI, O_RDWR, 0);
fd = open(_PATH_DEVPCI, O_RDONLY, 0);
if (fd < 0)
err(1, "%s", _PATH_DEVPCI);