From owner-FreeBSD-users-jp@jp.freebsd.org  Wed Apr 11 14:13:09 2001
Received: (from daemon@localhost)
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) id OAA84564;
	Wed, 11 Apr 2001 14:13:09 +0900 (JST)
	(envelope-from owner-FreeBSD-users-jp@jp.FreeBSD.org)
Received: from pixy.netlab.is.tsukuba.ac.jp (netlab-83.netlab.is.tsukuba.ac.jp [130.158.83.243])
	by castle.jp.freebsd.org (8.9.3+3.2W/8.7.3) with SMTP id OAA84559
	for <FreeBSD-users-jp@jp.freebsd.org>; Wed, 11 Apr 2001 14:13:09 +0900 (JST)
	(envelope-from ush@netlab.is.tsukuba.ac.jp)
Received: (qmail 53381 invoked from network); 11 Apr 2001 05:12:58 -0000
Received: from unknown (HELO localhost) (130.158.85.30)
  by 130.158.85.2 with SMTP; 11 Apr 2001 05:12:58 -0000
To: FreeBSD-users-jp@jp.freebsd.org
X-Mailer: Mew version 1.94.1 on Emacs 19.34 / Mule 2.3 (SUETSUMUHANA)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=iso-2022-jp
Content-Transfer-Encoding: 7bit
Message-Id: <20010411141459T.ush@netlab.is.tsukuba.ac.jp>
Date: Wed, 11 Apr 2001 14:14:59 +0900
From: Ushine Hiroyuki <ush@netlab.is.tsukuba.ac.jp>
X-Dispatcher: imput version 20000228(IM140)
Lines: 40
Reply-To: FreeBSD-users-jp@jp.freebsd.org
Precedence: list
X-Distribute: distribute version 2.1 (Alpha) patchlevel 24e+010328
X-Sequence: FreeBSD-users-jp 60743
Subject: [FreeBSD-users-jp 60743] cannot use pciconf -l by non-root user
Errors-To: owner-FreeBSD-users-jp@jp.freebsd.org
Sender: owner-FreeBSD-users-jp@jp.freebsd.org
X-Originator: ush@netlab.is.tsukuba.ac.jp

4.3-RC $B$G$b$=$&$J$s$G$9$,!$(B

man pciconf(8) $B$h$jH4?h(B
     The -l option is the only one available to non-root users.  All other in-
     vocations of pciconf require a selector of the form pcibus:device (op-
     tionally followed by :function).  A final colon may be appended and will
     be ignored; this is so that the first column in the output of pciconf -l
     can be used without modification.  All numbers are base 10.

pciconf -l $B$O(B non-root $B%f!<%6!<$G$b;H$($k$3$H$K$J$C$F$$$^$9$,!$(B
$B<B:]$K$O;HMQ$G$-$^$;$s!%$G$b%^%K%e%"%k$O$=$N$^$s$^$G$9!%(B
pciconf -l$B$,(B non-root user$B$GMxMQ$G$-$kI,MW$O$J$$$H(B
$B$*$b$&$N$G!$%^%K%e%"%k$r2~Dj$7$?J}$,$$$$$H$O;W$$$^$9!%(B

$B=$@52U=j$G$9$,!$(Bsrc/usr.sbin/pciconf.c $B$N(B
static void
list_devs(void)
$B$G(B
fd = open(_PATH_DEVPCI, O_RDWR, 0);
$B$H=q$$$F$"$j$^$9$,!$0lHL%f!<%6!<$K$O(B WR $B$r$G$-$^$;$s$N$G!$(B
$B>/$J$/$H$b(B
fd = open(_PATH_DEVPCI, O_RDONLY, 0);
$B$G$"$k$Y$-$G$9!%(B

$B%=!<%9$r8+$F$+$i(B send-pr $B$5$l$F$$$k5$$,$7$?$N$GD4$Y$?$H$3$m!$(B

Problem Report bin/23217
[PATCH] 'pciconf -l' opens /dev/pci with incorrect permissions
Arrival-Date: Fri Dec 01 14:20:01 PST 2000 
O_RDWR $B$+$i(B O_RDONLY $B$K$9$k$@$1$G$9!%(B

Problem Report kern/23216
[PATCH] PCIOCGETCONF ioctl requires write permissions
$B$G<($5$l$k(B src/sys/pci/pci.c $B$N%Q%C%A$G!$(BPCIOCGETCONF$B$N>l9g(B
WRITE$B%Q!<%_%C%7%g%s$H$O4X78$J$/DL$7$^$9!%(B

$B$=$&$7$J$$$H(B
pciconf: ioctl(PCIOCGETCONF): Operation not permitted
$B$H<B9T$G$-$^$;$s!%(B

