Bug 182600 - External optical drive owned by root if connected after normal user is logged in
External optical drive owned by root if connected after normal user is logged in
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: udev (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Harald Hoyer
:
: 159272 183934 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-23 11:40 EST by Kjartan Maraas
Modified: 2007-11-30 17:11 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-05-03 09:02:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Kjartan Maraas 2006-02-23 11:40:45 EST
Description of problem:

When I attach my external USB CDRW+DVD drive it becomes owned by root making it
inaccessible for my normal logged in user until I log out and back in.

[root@localhost cairo]# ls -l /dev/scd0
brw-r----- 1 root disk 11, 0 feb 23 17:37 /dev/scd0
[root@localhost cairo]# ls -l /dev/dvd
lrwxrwxrwx 1 root root 4 feb 23 17:37 /dev/dvd -> scd0

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 Kjartan Maraas 2006-02-23 11:49:20 EST
Possibly related stuff from /var/log/messages:

Feb 23 17:52:33 localhost udevd-event[5772]: wait_for_sysfs: waiting for
'/sys/block/sr0/bus' failed
Feb 23 17:52:33 localhost udevd-event[5773]: wait_for_sysfs: waiting for
'/sys/class/scsi_device/1:0:0:0/bus' failed
Feb 23 17:52:33 localhost udevd-event[5774]: wait_for_sysfs: waiting for
'/sys/class/scsi_generic/sg0/bus' failed


Comment 2 David Zeuthen 2006-02-23 19:28:53 EST
I'm pretty sure this is actually due to bug 182645

Kjartan: does downgrading udev to 084-1.1 make things work?
Comment 3 Kjartan Maraas 2006-03-06 03:52:09 EST
*** Bug 183934 has been marked as a duplicate of this bug. ***
Comment 4 Harald Hoyer 2006-03-06 07:38:59 EST
try newest udev plz!
Comment 5 Kjartan Maraas 2006-03-06 10:43:17 EST
The latest udev fixes the wait_for_sysfs: messages, but the device is still
owned by root when logging in.

[kmaraas@localhost gtksourceview]$ ls -l /dev/scd0
brw-r----- 1 root disk 11, 0 mar  6 16:45 /dev/scd0
[kmaraas@localhost gtksourceview]$ cat /proc/sys/dev/cdrom/info
CD-ROM information, Id: cdrom.c 3.20 2003/12/17

drive name:             sr0
drive speed:            24
drive # of slots:       1
Can close tray:         1
Can open tray:          1
Can lock tray:          1
Can change speed:       1
Can select disk:        0
Can read multisession:  1
Can read MCN:           1
Reports media changed:  1
Can play audio:         1
Can write CD-R:         1
Can write CD-RW:        1
Can read DVD:           1
Can write DVD-R:        0
Can write DVD-RAM:      0
Can read MRW:           1
Can write MRW:          1
Can write RAM:          1

I checked for any /dev/srX files and there are none.
Comment 6 David Zeuthen 2006-03-06 15:08:59 EST
I get this too with udev-084-11. 

The permissions are right on boot up with the drive attached

[davidz@orion ~]$ rpm -q udev
udev-084-11
[davidz@orion ~]$ ls -l /dev/cdrom*
lrwxrwxrwx 1 root root 4 Mar  6 15:00 /dev/cdrom -> scd0
lrwxrwxrwx 1 root root 3 Mar  6 15:00 /dev/cdrom-hdc -> hdc
lrwxrwxrwx 1 root root 3 Mar  6 15:00 /dev/cdrom-hdd -> hdd
lrwxrwxrwx 1 root root 4 Mar  6 15:00 /dev/cdrom-sr0 -> scd0
[davidz@orion ~]$ ls -l /dev/scd0 /dev/hdc /dev/hdd
brw------- 1 davidz disk 22,  0 Mar  6 15:00 /dev/hdc
brw------- 1 davidz disk 22, 64 Mar  6 15:00 /dev/hdd
brw------- 1 davidz disk 11,  0 Mar  6 15:00 /dev/scd0

but it's wrong on hotplug

[davidz@orion ~]$ ls -l /dev/scd0
brw-r----- 1 root disk 11, 0 Mar  6 15:12 /dev/scd0

running start_udev doesn't fix it either.

Comment 7 Harald Hoyer 2006-03-07 01:40:56 EST
huh? very strange... 
output of?
# udevtest $(udevinfo -q path -n /dev/scd0) block
# udevinfo -q all -n /dev/scd0

You also may set udev_log="debug" in 
/etc/udev/udev.conf
and run udevmonitor.
Comment 8 Kjartan Maraas 2006-03-07 13:39:03 EST
[root@localhost atk-bridge]# udevinfo -q path -n /dev/scd0
/block/sr0
[root@localhost atk-bridge]# udevtest /block/sr0 block
main: Usage: udevtest <devpath>
[root@localhost atk-bridge]# udevtest /block/sr0
main: looking at device '/block/sr0' from subsystem 'block'
udev_rules_get_name: add symlink 'cdrom'
udev_rules_get_name: add symlink 'cdrom-sr0'
run_program: 'check-cdrom.sh sr0 DVD'
run_program: '/lib/udev/check-cdrom.sh' returned with status 0
udev_rules_get_name: add symlink 'dvd'
udev_rules_get_name: add symlink 'dvd-sr0'
run_program: 'check-cdrom.sh sr0 CD-R'
run_program: '/lib/udev/check-cdrom.sh' returned with status 0
udev_rules_get_name: add symlink 'cdwriter'
udev_rules_get_name: add symlink 'cdwriter-sr0'
udev_rules_get_name: add symlink 'cdrw'
udev_rules_get_name: add symlink 'cdrw-sr0'
run_program: 'check-cdrom.sh sr0 DVD-R'
run_program: '/lib/udev/check-cdrom.sh' returned with status 1
udev_rules_get_name: rule applied, 'sr0' becomes 'scd0'
run_program: '/sbin/usb_id -x'
run_program: '/sbin/usb_id' (stdout) 'ID_VENDOR=TOSHIBA'
run_program: '/sbin/usb_id' (stdout) 'ID_MODEL=DVD-ROM_SD-R2512'
run_program: '/sbin/usb_id' (stdout) 'ID_REVISION=1A04'
run_program: '/sbin/usb_id' (stdout)
'ID_SERIAL=TOSHIBA_DVD-ROM_SD-R2512_WW46M90K5A30'
run_program: '/sbin/usb_id' (stdout) 'ID_TYPE=cd'
run_program: '/sbin/usb_id' (stdout) 'ID_BUS=usb'
run_program: '/sbin/usb_id' returned with status 0
udev_rules_get_name: add symlink
'disk/by-id/usb-TOSHIBA_DVD-ROM_SD-R2512_WW46M90K5A30'
run_program: '/sbin/path_id /block/sr0'
run_program: '/sbin/path_id' (stdout) 'ID_PATH=usb-WW46M90K5A30:0:0:0'
run_program: '/sbin/path_id' returned with status 0
udev_rules_get_name: add symlink 'disk/by-path/usb-WW46M90K5A30:0:0:0'
create_node: creating device node '/dev/scd0', major = '11', minor = '0', mode =
'0640', uid = '0', gid = '6'
create_node: creating symlink '/dev/cdrom' to 'scd0'
create_node: creating symlink '/dev/cdrom-sr0' to 'scd0'
create_node: creating symlink '/dev/dvd' to 'scd0'
create_node: creating symlink '/dev/dvd-sr0' to 'scd0'
create_node: creating symlink '/dev/cdwriter' to 'scd0'
create_node: creating symlink '/dev/cdwriter-sr0' to 'scd0'
create_node: creating symlink '/dev/cdrw' to 'scd0'
create_node: creating symlink '/dev/cdrw-sr0' to 'scd0'
create_node: creating symlink
'/dev/disk/by-id/usb-TOSHIBA_DVD-ROM_SD-R2512_WW46M90K5A30' to '../../scd0'
create_node: creating symlink '/dev/disk/by-path/usb-WW46M90K5A30:0:0:0' to
'../../scd0'
main: run: 'socket:/org/kernel/udev/monitor'
main: run: '/lib/udev/udev_run_devd'
main: run: 'socket:/org/freedesktop/hal/udev_event'
[root@localhost atk-bridge]# udevinfo -q all -n /dev/scd0
P: /block/sr0
N: scd0
S: cdrom
S: cdrom-sr0
S: dvd
S: dvd-sr0
S: cdwriter
S: cdwriter-sr0
S: cdrw
S: cdrw-sr0
S: disk/by-id/usb-TOSHIBA_DVD-ROM_SD-R2512_WW46M90K5A30
S: disk/by-path/usb-WW46M90K5A30:0:0:0
E: ID_VENDOR=TOSHIBA
E: ID_MODEL=DVD-ROM_SD-R2512
E: ID_REVISION=1A04
E: ID_SERIAL=TOSHIBA_DVD-ROM_SD-R2512_WW46M90K5A30
E: ID_TYPE=cd
E: ID_BUS=usb
E: ID_PATH=usb-WW46M90K5A30:0:0:0
[root@localhost atk-bridge]#

log output when attaching the drive:

UEVENT[1141756910.547906] add@/devices/pci0000:00/0000:00:12.2/usb3/3-3
UEVENT[1141756910.548472] add@/devices/pci0000:00/0000:00:12.2/usb3/3-3/3-3:1.0
UEVENT[1141756910.548595] add@/class/usb_device/usbdev3.4
UDEV  [1141756910.801473] add@/devices/pci0000:00/0000:00:12.2/usb3/3-3
UEVENT[1141756911.283708] add@/module/scsi_mod
UEVENT[1141756911.283810] add@/module/usb_storage
UEVENT[1141756911.283842] add@/bus/usb/drivers/usb-storage
UEVENT[1141756911.283875] add@/class/scsi_host/host0
UDEV  [1141756911.725114] add@/devices/pci0000:00/0000:00:12.2/usb3/3-3/3-3:1.0
UDEV  [1141756911.792482] add@/class/scsi_host/host0
UDEV  [1141756912.095247] add@/class/usb_device/usbdev3.4
UEVENT[1141756916.253774]
add@/devices/pci0000:00/0000:00:12.2/usb3/3-3/3-3:1.0/host0/target0:0:0/0:0:0:0
UEVENT[1141756916.254932] add@/class/scsi_device/0:0:0:0
UDEV  [1141756916.304949]
add@/devices/pci0000:00/0000:00:12.2/usb3/3-3/3-3:1.0/host0/target0:0:0/0:0:0:0
UEVENT[1141756916.466561] add@/module/sg
UEVENT[1141756916.516221] add@/class/scsi_generic/sg0
UEVENT[1141756916.588285] add@/module/sr_mod
UEVENT[1141756916.594121] add@/bus/scsi/drivers/sr
UEVENT[1141756916.716498] add@/block/sr0
UDEV  [1141756916.731285] add@/class/scsi_device/0:0:0:0
UDEV  [1141756916.871744] add@/class/scsi_generic/sg0
UDEV  [1141756917.241671] add@/block/sr0
Comment 9 Kjartan Maraas 2006-05-03 09:02:37 EDT
This works for me now. Closing.
Comment 10 John Thacker 2006-05-05 10:41:28 EDT
*** Bug 159272 has been marked as a duplicate of this bug. ***

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