From owner-freebsd-stable@FreeBSD.ORG Sun Nov 20 17:48:54 2005 Return-Path: X-Original-To: stable@freebsd.org Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C5DA016A41F for ; Sun, 20 Nov 2005 17:48:54 +0000 (GMT) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr8.xs4all.nl (smtp-vbr8.xs4all.nl [194.109.24.28]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB70843D66 for ; Sun, 20 Nov 2005 17:48:47 +0000 (GMT) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr8.xs4all.nl (8.13.3/8.13.3) with ESMTP id jAKHlslS023933; Sun, 20 Nov 2005 18:47:54 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 2AEBCB824; Sun, 20 Nov 2005 18:47:54 +0100 (CET) Date: Sun, 20 Nov 2005 18:47:54 +0100 From: Roland Smith To: Holger Kipp Message-ID: <20051120174754.GA33044@slackbox.xs4all.nl> References: <20051120131624.GB35164@intserv.int1.b.intern> <20051120140422.GA26681@slackbox.xs4all.nl> <20051120163736.GA39037@intserv.int1.b.intern> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="X1bOJ3K7DJ5YkBrT" Content-Disposition: inline In-Reply-To: <20051120163736.GA39037@intserv.int1.b.intern> User-Agent: Mutt/1.4.2.1i X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! X-Virus-Scanned: by XS4ALL Virus Scanner Cc: stable@freebsd.org Subject: Re: FBSD-6 usb/scanner-access-rights X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2005 17:48:54 -0000 --X1bOJ3K7DJ5YkBrT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 20, 2005 at 05:37:36PM +0100, Holger Kipp wrote: > Dear Roland, >=20 > thank you very much for your answer. >=20 > On Sun, Nov 20, 2005 at 03:04:22PM +0100, Roland Smith wrote: > > On Sun, Nov 20, 2005 at 02:16:24PM +0100, Holger Kipp wrote: > > >=20 > > > Is there an easy way to name the devices a user might > > > be allowed to access rw, without compromising the system? > > > I don't want to give operator group to these users, > > > and I don't want to blindly allow access to some=20 > > > da- or pass-devices where I cannot determine the order > > > of numbering easily. > >=20 > > One thing you could do is make the groups usb and cdrom and make them > > the groups owning the relevant devices, e.g. by putting the following in > > /etc/devfs.rules: > >=20 > > add path 'da*s*' mode 0660 group usb > > add path 'uscanner*' mode 0660 group usb >=20 > ah, I had the entry=20 > "add path 'uscanner*' mode 0660 group usb"=20 > missing in the devfs.rules-file > but this still does not help... >=20 > uscanner0 is here: >=20 > uscanner0: EPSON EPSON Scanner, rev 1.10/1.00, addr 2 >=20 >=20 > sane-find-scanner has the following to say: > found USB scanner (UNKNOWN vendor and product) at device /dev/uscanner0 Doesn't matter that you get "UNKNOWN". It _will_ work with sane without access to /dev/usb*. It does here. > Yes, but there is a problem with numbering of pass-devices: >=20 > with card-reader attached during boot, I have: > at scbus0 target 0 lun 0 (da0,pass0) > at scbus0 target 0 lun 1 (da1,pass1) > at scbus0 target 0 lun 2 (da2,pass2) > at scbus0 target 0 lun 3 (da3,pass3) > at scbus2 target 0 lun 0 (pass4,cd0) > at scbus2 target 1 lun 0 (pass5,cd1) >=20 > attaching card-reader afterwards gives different numbering: > after boot: > katrin# camcontrol devlist > at scbus1 target 0 lun 0 (cd1,pass1) > at scbus1 target 1 lun 0 (cd0,pass0) > after attaching cardreader: > katrin# camcontrol devlist > at scbus1 target 0 lun 0 (cd1,pass1) > at scbus1 target 1 lun 0 (cd0,pass0) > at scbus4 target 0 lun 0 (da0,pass2) > at scbus4 target 0 lun 1 (da1,pass3) > at scbus4 target 0 lun 2 (da2,pass4) > at scbus4 target 0 lun 3 (da3,pass5) >=20 > so allowing access to cd0/cd1 and corresponding pass0 and pass1 will > break if computer is booted with usb-cardreader attached. not good. It was an example. I don't have many usb devices, so it works for me. :-) > > If that is not fine-grained enough, maybe ACLs might help. See setfacl(= 1). >=20 > so we currently have: >=20 > - rights needed not only for the device itself, but also for the bus > and or control devices (pass, usb, xpt0) Yes, but ACL give fine-grained access control. And no matter how you look at it, you _have_ to trust the person whom you give access to the pass devices. It's in the FreeBSD architecture. > - dynamic numbering (pass). >=20 > I agree that usb is a nightmare and should never have happened. :-) For disc devices, you could use GEOM_LABEL. That'll give you consistent /dev/label/ names. Roland --=20 R.F.Smith (http://www.xs4all.nl/~rsmith/) Please send e-mail as plain text. public key: http://www.xs4all.nl/~rsmith/pubkey.txt --X1bOJ3K7DJ5YkBrT Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDgLbKEnfvsMMhpyURAnFaAKCiwIOgGA/+SUydBjtXmRYbtIeiFgCgmQ3j PRkVaKlxwVdqQf9vDBp/Qss= =job2 -----END PGP SIGNATURE----- --X1bOJ3K7DJ5YkBrT--