summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pciconf
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2003-12-31 19:38:29 +0000
committerrwatson <rwatson@FreeBSD.org>2003-12-31 19:38:29 +0000
commit0d9473dba7110a59250f8d778016e32f9e54a0d1 (patch)
tree1b6719c5bde594acee7b5ec75a0f6f07f0728e6b /usr.sbin/pciconf
parentef685e7d618ec3abf9519aaf96d01f3b7a274523 (diff)
downloadFreeBSD-src-0d9473dba7110a59250f8d778016e32f9e54a0d1.zip
FreeBSD-src-0d9473dba7110a59250f8d778016e32f9e54a0d1.tar.gz
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>
Diffstat (limited to 'usr.sbin/pciconf')
-rw-r--r--usr.sbin/pciconf/pciconf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c
index 0dc9dcc..0ea232a 100644
--- a/usr.sbin/pciconf/pciconf.c
+++ b/usr.sbin/pciconf/pciconf.c
@@ -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);
OpenPOWER on IntegriCloud