Bug 165888 - USB pilot devices have wrong ownership
USB pilot devices have wrong ownership
Product: Fedora
Classification: Fedora
Component: udev (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
Depends On:
  Show dependency treegraph
Reported: 2005-08-13 12:56 EDT by Dan Christian
Modified: 2007-11-30 17:11 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-08-25 06:43:48 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Dan Christian 2005-08-13 12:56:53 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.10) Gecko/20050720 Fedora/1.0.6-1.1.fc4 Firefox/1.0.6

Description of problem:
When you try to sync a USB based pilot device, the device nodes are created without regard to who is on console.

I found /etc/udev/rules.d/50-udev.rules but there isn't any (documented) way to set the owner to the console owner.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Login under X as a normal user (not root)
2.  Plug in a USB pilot and hit hotsync
3.  ls -l /dev/ttyUSB?

Actual Results:  /dev/ttyUSB0 is owned by root and not writable by the console user.

Expected Results:  /dev/ttyUSB0 should be owned by the console user and only writable by them.

Additional info:

udev is poorly documented.  I found udevinfo, but I couldn't figure out how to created a proper rules.d entry from the information it gave.

Also, the precedence order in /etc/udev/rules.d isn't clear.

What we really need is a file do drop into rules.d that solves this problem for a given pilot type (and creates a /dev/pilot link).  I couldn't find anyone who had figured out how to do this.  Everyone just changed 50-udev.rules to make the link world writable, but that is a security problem.

It's not clear how all this interacts with /etc/security/console.perms.
Comment 1 Pete Toscano 2005-08-15 09:17:35 EDT
udev seems to have some issues with adding local rules and overriding the ones
in 50-udev.rules.  Normally, you see people put the following in something like

KERNEL="ttyUSB1", SYMLINK="pilot"

This will change the behavior of udev to a) add a symlink named pilot that
points to ttyUSB1, b) change the owner of ttyUSB1 to that of the person logged
into X, and c) change the permissions from 0660 to 0600.  Why this affects the
owner and permissions, I have no idea.

Now, if you want to change the group to something other than the udev default,
you need to rename the 10-local.rules file to something that occurs
(lexographically) after the 50-udev.rules file.  I use 60-local.rules.  This
will create the /dev/pilot symlink and change the group to foo:

KERNEL="ttyUSB1", SYMLINK="pilot", GROUP="foo"

Now, you _should_ be able to change the OWNER and MODE with the overriding
local.rules files using something like this:

KERNEL="ttyUSB1", SYMLINK="pilot", GROUP="foo", OWNER="foo", MODE="0666"

Unfortunately, I haven't been able to figure out how to, using either the
10-local.rules file or the 60-local.rules file.  If I want to change the owner
or mode of a udev-created device, I need to edit the 50-udev.rules file, which
seems to blow away the whole reason for the override files.

I'm also concerned with what seems to be the change in the priority of the rules
Comment 2 Dan Christian 2005-08-15 23:31:48 EDT
> KERNEL="ttyUSB0", SYMLINK="pilot"

That does work.  I would have never guessed it from the documentation. 
Everything works for my Clie now.


[root@faraday rules.d]# ll /dev/pilot /dev/ttyUSB?
lrwxrwxrwx  1 root root      7 Aug 15 20:11 /dev/pilot -> ttyUSB0
crw-------  1 dac  uucp 188, 0 Aug 15 20:11 /dev/ttyUSB0
crw-rw----  1 root uucp 188, 1 Aug 15 20:11 /dev/ttyUSB1

Note You need to log in before you can comment on or make changes to this bug.