Date: Fri, 3 Dec 2004 02:29:26 +0100 From: Christian Hiris <4711@chello.at> To: freebsd-questions@freebsd.org Cc: maarfree@xs4all.nl Subject: Re: /dev/uscanner0 owned by root:scanner but only access for users of group operator Message-ID: <200412030229.44502.4711@chello.at> In-Reply-To: <4948.80.127.55.226.1102025173.squirrel@80.127.55.226> References: <4948.80.127.55.226.1102025173.squirrel@80.127.55.226>
next in thread | previous in thread | raw e-mail | index | archive | help
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thursday 02 December 2004 23:06, maarfree@xs4all.nl wrote: > Hi list, > > I have my Canon Lide 20 usb scanner working om my system. Setup was easy > following the handbook. > > But I did not like all users being member of group operator; > So I added a group scanner, > to /dev/devfs.rules I add: > add path uscanner0 mode 0660 group scanner # (group scanner is added) > I add a user to group scanner. > When I do ll /dev/uscanner0 > crw-rw---- 1 root scanner 233, 0 Dec 2 22:24 /dev/uscanner0 > When I do sane-find-scanner as the user I get: > found USB scanner (UNKNOWN vendor and product) at device /dev/uscanner0 > and subsequently the scanner is not useable for the user. > But when I add this user to group operator: > found USB scanner (vendor=0x04a9, product=0x220d) at /dev/uscanner0 > and the scanner is working. > but I see the scanner still belongs to user root and group scanner... > > Anyone an idea? You probably need to change the corresponding /dev/usbN device nodes, too (I must say that, I never tested this with devfs.rules). In my experience sane-find-scanner steps thru the usb devices and exits, if it hasn't proper permissions on a usb device node. For real-life scanning apps like xsane and xscanimage you can define SANE_DEFAULT_DEVICE in your environment. This should stop the apps from stepping thru the usb device nodes. JFYI: There is a (dirty) way to work around the needs of adding users to a scanner specific group. You can set /dev/uscanner0 and the corresponding /dev/usbN to world read- and writeable via usbd and usbd.conf. % cat /etc/usbd.conf.my # Scanners device "Scanner" devname "uscanner[0-9]+" attach "chmod 666 /dev/${DEVNAME} ; chmod 666 /dev/usb0" detach "chmod 660 /dev/usb0" % cat /etc/rc.conf | grep usb usbd_enable="YES" # Run the usbd daemon. usbd_flags="-c /etc/usbd.conf.my" # Flags to usbd (if enabled). But this method also opens a can of worms: All devices nodes down to the usb device to where your scanner is connected to must be set world read- and writeable. ie. when you connect your scanner to /dev/usb1 the devices /dev/usb0, /dev/usb1 and /dev/uscanner0 must be set to mode 666. For this reason, I attached my scanner to /dev/usb0. To work around this, you can define SANE_DEFAULT_DEVICE as mentioned above. - -- Christian Hiris <4711@chello.at> | OpenPGP KeyID 0x3BCA53BE OpenPGP-Key at hkp://wwwkeys.eu.pgp.net and http://pgp.mit.edu -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (FreeBSD) iD4DBQFBr8GI09WjGjvKU74RAkh9AJ9bVHPSEhASe87HqQNif/Q4ypLH9gCXQSDn TNKSbpmUzSS65b6ntdJ69Q== =Vhy/ -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200412030229.44502.4711>