From 6c72866dffa8fa58fd1af433c9b4c62f3e157175 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Wed, 31 Dec 2003 19:38:29 +0000 Subject: [PATCH] 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 --- usr.sbin/pciconf/pciconf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.sbin/pciconf/pciconf.c b/usr.sbin/pciconf/pciconf.c index 0dc9dccc732a..0ea232aea408 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);