From owner-freebsd-stable@FreeBSD.ORG Tue Nov 8 22:50:12 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E9AF16A41F for ; Tue, 8 Nov 2005 22:50:12 +0000 (GMT) (envelope-from andyfraser@gmail.com) Received: from mail.linuxuser.org.uk (213-152-59-115.dsl.eclipse.net.uk [213.152.59.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 37E2843D49 for ; Tue, 8 Nov 2005 22:50:11 +0000 (GMT) (envelope-from andyfraser@gmail.com) Received: from localhost (mantis.linuxuser.org.uk [127.0.0.1]) by mail.linuxuser.org.uk (Postfix) with ESMTP id 19A7D2075A for ; Tue, 8 Nov 2005 22:50:10 +0000 (GMT) Received: from mail.linuxuser.org.uk ([127.0.0.1]) by localhost (mantis.linuxuser.org.uk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 10335-08 for ; Tue, 8 Nov 2005 22:50:05 +0000 (GMT) Received: from wasp.linuxuser.org.uk (wasp.linuxuser.org.uk [192.168.0.10]) by mail.linuxuser.org.uk (Postfix) with ESMTP id E1A2820528 for ; Tue, 8 Nov 2005 22:50:04 +0000 (GMT) From: Andy Fraser To: freebsd-stable@freebsd.org Date: Tue, 8 Nov 2005 22:50:04 +0000 User-Agent: KMail/1.8.3 References: <200511082054.42113.andyfraser@gmail.com> <200511090841.36177.doconnor@gsoft.com.au> In-Reply-To: <200511090841.36177.doconnor@gsoft.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200511082250.04433.andyfraser@gmail.com> X-Virus-Scanned: by amavisd-new (Gentoo) at linuxuser.org.uk Subject: Re: USB Card Reader Permissions X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2005 22:50:12 -0000 On Tuesday 08 Nov 2005 10:11 pm, Daniel O'Connor wrote: > > I was wondering if someone could tell me how to set the permissions for a > > USB card reader when it's plugged in? I've been Googling for hours and > > found nothing concrete so far although I'll keep looking. > > devfs.conf can do it. I thought that was only for devices that exist at boot? I have my DVD burner set up in devfs.conf so I can use it as my user (reading and burning with some other tweaks[1]). > > So far I have this situation: > > I plug in the card reader and device nodes are created > > (e.g. /dev/da0s1, /dev/da1s1 etc). I can mount this as root and if I > > manually set the permissions I can mount it as my user too. What I can't > > work out is how to change the permissions when I plug it in so I can just > > use the reader as my user. > > [inchoate 8:36] ~ >cat /etc/devfs.rules > [root=100] > > add path 'da*' group operator mode 660 I already had something like this... > And in rc.conf.. > devfs_system_ruleset="root" ...and this turned out to be the missing piece in the jigsaw. > > I've read the man pages for devfs, devfs.conf and devfs.rules. > > devfs.rules looks like what I need but I can't work out what I actually > > need to do or how to test a rule without rebooting. > > It isn't very obvious :( > You can test your changes by doing.. > /etc/rc.d/devfs restart I'd been trying that. It turns out I had completely missed the rc.conf line above so obviously restarting devfs had no effect. Many thanks Daniel. It's working just how I want it now. :-) [1] One of the reasons I first tried FreeBSD as a desktop OS was because it has better support for CD/DVD burning as a user than Linux does (I still can't get burning working reliably with Gentoo but FreeBSD works flawlessly). And the sound system is much better but that's another story. :-) -- Andy.