udev and user-space access

Nik fedora at babel.homelinux.net
Tue Dec 29 10:59:17 UTC 2009


Hi,

I've just been trying to access a digital camera over USB on FC10, and 
encountered a problem involving udev.

I could not access the digital camera (Ricoh Caplio G4) from any of the 
graphics programs such as gThumb or DigiKam.
(I could on earlier versions of FC.)

The error message in FC10 stated that the software could not get control 
of the USB device (permission denied).

I have found that manually giving users (not root) RW access to the 
appropriate /dev/ file fixes the problem.

However, if I write a rule in (say) /etc/udev/rules.d/45-cameras.rules 
that sets the group to "users" and the mode to "660", the problem isn't 
actually fixed automatically.

It turns out that my new rule causes the permissions to be set on 
/dev/usbdev{bus}.{device}_ep{XYZ}, whereas the graphics programs are 
trying to access the device through /dev/bus/usb/00{bus}/00{device}.

And sadly, the %p value in the rule is not equivalent to either of these.

Having spent all day on trying various things that don't work, I have 
currently added a RUN+= option to my rule that does a (shotgun) fix: 
"chgrp -R users /dev/bus/usb/*; chmod -R g+rw /dev/bus/usb/*"

Q1: So what is the best practice for fixing udev permissions so that a 
USB device allows user-mode access?

Reading various docs on the udev site suggests I write a permissions file.
I see that there is not even a /etc/udev/permissions.d directory on my 
Fedora installation, so any file I write would be the one and only file.

The udev doc says:
"New permissions should be placed in a file, which ends in .permissions 
in /etc/udev/permissions.d/. Please do not use 50-udev.permissions."

Q2: What should a line in a permissions file look like?

Q2a: Are they anything like those in 
/etc/security/console.perms.d/50-default.perms?
<console>  0600 <pilot>      0660 root.uucp

Thanks in advance for any and all responses.

Cheers!
Nik




More information about the fedora-list mailing list