From owner-freebsd-questions@FreeBSD.ORG Thu Apr 29 20:41:10 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C4E2F1065676 for ; Thu, 29 Apr 2010 20:41:10 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 7D7C08FC12 for ; Thu, 29 Apr 2010 20:41:09 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.3/8.14.3) with ESMTP id o3TKf89d025796; Thu, 29 Apr 2010 14:41:08 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.3/8.14.3/Submit) with ESMTP id o3TKf8tH025793; Thu, 29 Apr 2010 14:41:08 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Thu, 29 Apr 2010 14:41:08 -0600 (MDT) From: Warren Block To: Marco Beishuizen In-Reply-To: Message-ID: References: <20100428182223.GA34355@slackbox.erewhon.net> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.3 (wonkity.com [127.0.0.1]); Thu, 29 Apr 2010 14:41:08 -0600 (MDT) Cc: Roland Smith , freebsd-questions@freebsd.org Subject: Re: Using a scanner (USB) as user and not as root X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Apr 2010 20:41:10 -0000 On Thu, 29 Apr 2010, Marco Beishuizen wrote: > On Wed, 28 Apr 2010, Warren Block wrote: > >> You can use devd.conf for this: >> >> attach 100 { >> device-name "ugen[0-9].[0-9]"; >> match "vendor" "0x04b8"; >> match "product" "0x010a"; >> action "usb_devaddr=`echo $device-name | sed 's#^ugen##'` && \ >> chown root:saned /dev/usb/${usb_devaddr}.* && \ >> chmod 0660 /dev/usb/${usb_devaddr}.* >> >> Copied from a post on -current or similar; apologies to the author, who >> I've forgotten. I thought this was in the default devd.conf as an example, >> but it appears not. >> >> devfs.rules don't apply to devices that are created dynamically after >> boot-up. Or I guess they might be if you reload the ruleset with applyset >> after the device is created, but devd is a lot more capable. > > Unfortunately this didn't help either (I replaced the vendor and product with > the correct digits for my scanner, and the chown with the user name). The usb > devices are still owned by root and not accessible as user. For the sake of completeness: devd has to be restarted after changes to devd.conf, and the code above is only executed when the scanner is detected (USB cable plugged in or scanner powered on). -Warren Block * Rapid City, South Dakota USA