Date: Sun, 20 Nov 2005 18:47:54 +0100 From: Roland Smith <rsmith@xs4all.nl> To: Holger Kipp <hk@alogis.com> Cc: stable@freebsd.org Subject: Re: FBSD-6 usb/scanner-access-rights Message-ID: <20051120174754.GA33044@slackbox.xs4all.nl> In-Reply-To: <20051120163736.GA39037@intserv.int1.b.intern> References: <20051120131624.GB35164@intserv.int1.b.intern> <20051120140422.GA26681@slackbox.xs4all.nl> <20051120163736.GA39037@intserv.int1.b.intern>
next in thread | previous in thread | raw e-mail | index | archive | help
--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. <snip> > Yes, but there is a problem with numbering of pass-devices: >=20 > with card-reader attached during boot, I have: > <SMSC 223 U HS-CF 1.95> at scbus0 target 0 lun 0 (da0,pass0) > <SMSC 223 U HS-MS 1.95> at scbus0 target 0 lun 1 (da1,pass1) > <SMSC 223 U HS-SM 1.95> at scbus0 target 0 lun 2 (da2,pass2) > <SMSC 223 U HS-SD/MMC 1.95> at scbus0 target 0 lun 3 (da3,pass3) > <HL-DT-ST DVDRAM GSA-4163B A102> at scbus2 target 0 lun 0 (pass4,cd0) > <HL-DT-ST RW/DVD GCC-4120B 2.01> at scbus2 target 1 lun 0 (pass5,cd1) >=20 > attaching card-reader afterwards gives different numbering: > after boot: > katrin# camcontrol devlist > <HL-DT-ST DVDRAM GSA-4163B A102> at scbus1 target 0 lun 0 (cd1,pass1) > <HL-DT-ST RW/DVD GCC-4120B 2.01> at scbus1 target 1 lun 0 (cd0,pass0) > after attaching cardreader: > katrin# camcontrol devlist > <HL-DT-ST DVDRAM GSA-4163B A102> at scbus1 target 0 lun 0 (cd1,pass1) > <HL-DT-ST RW/DVD GCC-4120B 2.01> at scbus1 target 1 lun 0 (cd0,pass0) > <SMSC 223 U HS-CF 1.95> at scbus4 target 0 lun 0 (da0,pass2) > <SMSC 223 U HS-MS 1.95> at scbus4 target 0 lun 1 (da1,pass3) > <SMSC 223 U HS-SM 1.95> at scbus4 target 0 lun 2 (da2,pass4) > <SMSC 223 U HS-SD/MMC 1.95> 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<x>, usb<x>, 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<x>). >=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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20051120174754.GA33044>