From owner-freebsd-questions@FreeBSD.ORG Thu Apr 29 20:32:40 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 8952F1065670 for ; Thu, 29 Apr 2010 20:32:40 +0000 (UTC) (envelope-from demelier.david@gmail.com) Received: from mail-bw0-f216.google.com (mail-bw0-f216.google.com [209.85.218.216]) by mx1.freebsd.org (Postfix) with ESMTP id 11FAF8FC1F for ; Thu, 29 Apr 2010 20:32:39 +0000 (UTC) Received: by bwz8 with SMTP id 8so14621868bwz.3 for ; Thu, 29 Apr 2010 13:32:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=f6d2Jr8+VUIfMYbv8cOUJCb+wbANF9NrDe5F/YY5nKU=; b=V+PLQmo5mSnGLh84zfOAR9fUzXWJcUQGKFLjAN7R1ig10qIj6L7RtUWMfCM85g6JLN 1Kq3AWZkOfWjgq83OFU3a3KmH4I1GPBo2qLzlSxosjaiSw69ZsXmp67jt+1HqBJDKgWv PtYxTdr4IVL7gl3uTnB8fC9jPMtCS4lu6tDDM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=lTt4YgB7sGQ59NDHCJnuVE1tx0T/RMGWNqHzOaYAfoipcpdrUhvdEKajaVOxtM6Nbh yp5iQO0g4Nff4kbknNlAwm/NJm2LnuFMyDmCX0e/IMq/r1hKN1hccO3rCdZrxh3e3/CF 2bsoSrhisCA61Q3t6ZlLoKhE+RnVDHYazJ08Y= MIME-Version: 1.0 Received: by 10.204.21.20 with SMTP id h20mr6401222bkb.149.1272573153306; Thu, 29 Apr 2010 13:32:33 -0700 (PDT) Received: by 10.204.54.82 with HTTP; Thu, 29 Apr 2010 13:32:33 -0700 (PDT) In-Reply-To: References: <20100428182223.GA34355@slackbox.erewhon.net> Date: Thu, 29 Apr 2010 22:32:33 +0200 Message-ID: From: David DEMELIER To: Warren Block Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Cc: Roland Smith , Marco Beishuizen , 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:32:40 -0000 2010/4/28 Warren Block : > On Wed, 28 Apr 2010, Marco Beishuizen wrote: > >> On Wed, 28 Apr 2010, Roland Smith wrote: >> >>> Are the permissions correct? Check with 'ls -l /dev/usb/ /dev/ugen*'. >>> Is your user-id in the usb group? Check by running 'id' as the normal >>> user. >>> >>> If all that is in order, remove all lines except the three above from >>> /etc/devfs.rules, and try again. >> >> Running id as user looks ok: >> >> uid=3D1001(marco) gid=3D0(wheel) groups=3D0(wheel),5(operator),1001(usb) >> >> But the permissions are not: >> >> ls -l /dev/usb/ /dev/ugen* >> lrw-rw-r-- =A01 root =A0usb =A09 Apr 28 19:05 /dev/ugen0.1 -> usb/0.1.0 >> lrw-rw-r-- =A01 root =A0usb =A09 Apr 28 19:05 /dev/ugen1.1 -> usb/1.1.0 >> lrw-rw-r-- =A01 root =A0usb =A09 Apr 28 21:05 /dev/ugen1.2 -> usb/1.2.0 >> lrw-rw-r-- =A01 root =A0usb =A09 Apr 28 21:05 /dev/ugen1.3 -> usb/1.3.0 >> lrw-rw-r-- =A01 root =A0usb =A09 Apr 28 19:05 /dev/ugen2.1 -> usb/2.1.0 >> >> /dev/usb/: >> total 0 >> crw------- =A01 root =A0operator =A0 =A00, =A087 Apr 28 19:05 0.1.0 >> crw------- =A01 root =A0operator =A0 =A00, =A093 Apr 28 19:05 0.1.1 >> crw------- =A01 root =A0operator =A0 =A00, =A089 Apr 28 19:05 1.1.0 >> crw------- =A01 root =A0operator =A0 =A00, =A094 Apr 28 19:05 1.1.1 >> crw------- =A01 root =A0operator =A0 =A00, 104 Apr 28 21:05 1.2.0 >> crw------- =A01 root =A0operator =A0 =A00, 105 Apr 28 21:05 1.2.1 >> crw------- =A01 root =A0operator =A0 =A00, 117 Apr 28 21:05 1.3.0 >> crw------- =A01 root =A0operator =A0 =A00, 119 Apr 28 21:05 1.3.1 >> crw------- =A01 root =A0operator =A0 =A00, =A091 Apr 28 19:05 2.1.0 >> crw------- =A01 root =A0operator =A0 =A00, =A095 Apr 28 19:05 2.1.1 > > You can use devd.conf for this: > > attach 100 { > =A0 =A0 =A0 =A0device-name "ugen[0-9].[0-9]"; > =A0 =A0 =A0 =A0match "vendor" "0x04b8"; > =A0 =A0 =A0 =A0match "product" "0x010a"; > =A0 =A0 =A0 =A0action "usb_devaddr=3D`echo $device-name | sed 's#^ugen##'= ` && \ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0chown root:saned /dev/usb/${usb_devaddr}.*= && \ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0chmod 0660 /dev/usb/${usb_devaddr}.* > > Copied from a post on -current or similar; apologies to the author, who I= 've > forgotten. =A0I 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. =A0Or I guess they might be if you reload the ruleset with apply= set > after the device is created, but devd is a lot more capable. > from devfs.rules(5) : NAME devfs.rules =97 devfs configuration information DESCRIPTION The devfs.rules file provides an easy way to create and apply devfs(8) rules, *even for devices that are not available at boot.* But devfs.rules is specially made for device not available at boot such as usb keys. > -Warren Block * Rapid City, South Dakota USA > _______________________________________________ > freebsd-questions@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.o= rg" > --=20 Demelier David