USB Card Reader Permissions

Andy Fraser andyfraser at gmail.com
Tue Nov 8 14:50:12 PST 2005


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.


More information about the freebsd-stable mailing list