You are not logged in.

#1 2009-04-04 18:54:17

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Udev stubbornly refuses to reassign group ownership

I recently found out about Wammu and decided to try it - and I liked it smile. The thing is, the device files created by udev are root:root and not world-readable (which is normal, and secure), so I didn't bother at first. I gave Wammu a test run as root to see if it could talk to my phone - and it could.

Then I tried to write a matching udev rule to get the device files reassigned to the storage group, so users can access them. Since assigning a user ownership does seem to work, just consider this a complaint if you want tongue.

This is my udev rule (storage is an existing group):

KERNEL=="ttyACM[0-9]", ATTRS{manufacturer}=="Sony Ericsson", ATTRS{product}=="Sony Ericsson W880", GROUP="storage", SYMLINK="modem"

I have added the SYMLINK directive as a check to see whether udev matches the rule. This yields the following:

[stijn@apollo ~]$ ls /dev/ttyACM* -l
crw-rw---- 1 root root 166, 0 apr  4 20:33 /dev/ttyACM0
crw-rw---- 1 root root 166, 1 apr  4 20:33 /dev/ttyACM1
[stijn@apollo ~]$ls /dev/modem -l
lrwxrwxrwx 1 root root 7 apr  4 20:39 /dev/modem -> ttyACM1

The group does not get assigned, but the SYMLINK directive gets followed - so there is a match. Udev just doesn't change the group (for whatever reason).

Now let's see how assigning a user works:

KERNEL=="ttyACM[0-9]", ATTRS{manufacturer}=="Sony Ericsson", ATTRS{product}=="Sony Ericsson W880", OWNER="stijn", SYMLINK="modem"

Will result in:

[stijn@apollo ~]$ ls /dev/ttyACM* -l
crw-rw---- 1 stijn root 166, 0 apr  4 20:40 /dev/ttyACM0
crw-rw---- 1 stijn root 166, 1 apr  4 20:40 /dev/ttyACM1
[stijn@apollo ~]$ls /dev/modem -l
lrwxrwxrwx 1 root root 7 apr  4 20:39 /dev/modem -> ttyACM0

I really don't know what to say roll. I haven't found any reports about udev refusing to assign group ownership, and I tried some workarounds like RUN+ and PROGRAM calling chown (dirty, yes), none work.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB