From owner-freebsd-questions@FreeBSD.ORG Fri Dec 3 01:29:47 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C462116A4CE for ; Fri, 3 Dec 2004 01:29:47 +0000 (GMT) Received: from chello084114137224.1.15.vie.surfer.at (chello084114137224.1.15.vie.surfer.at [84.114.137.224]) by mx1.FreeBSD.org (Postfix) with SMTP id 6C49B43D2D for ; Fri, 3 Dec 2004 01:29:46 +0000 (GMT) (envelope-from 4711@chello.at) Received: (qmail 58311 invoked from network); 3 Dec 2004 01:29:44 -0000 Received: from matrix010.matrix.net (192.168.123.10) by ns.matrix.net with SMTP; 3 Dec 2004 01:29:44 -0000 From: Christian Hiris <4711@chello.at> To: freebsd-questions@freebsd.org Date: Fri, 3 Dec 2004 02:29:26 +0100 User-Agent: KMail/1.7 References: <4948.80.127.55.226.1102025173.squirrel@80.127.55.226> In-Reply-To: <4948.80.127.55.226.1102025173.squirrel@80.127.55.226> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200412030229.44502.4711@chello.at> cc: maarfree@xs4all.nl Subject: Re: /dev/uscanner0 owned by root:scanner but only access for users of group operator X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Dec 2004 01:29:48 -0000 -----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-----