Bug 406891 - HAL prevent USB kamera to be accessed an user (not root)
Summary: HAL prevent USB kamera to be accessed an user (not root)
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: hal
Version: 7
Hardware: i386
OS: Linux
low
low
Target Milestone: ---
Assignee: David Zeuthen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2007-11-30 19:52 UTC by Csaba Ortutay
Modified: 2013-03-06 03:53 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-06-17 02:54:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Csaba Ortutay 2007-11-30 19:52:07 UTC
Description of problem:

I noticed that after update everything yesterday (30/11/07) on my fedora 7
systems I cannod access my Canon PowerShot A610 camera as user, just as root. I
tested it with gphoto2 and digikam. Both worked as root, but not as user.

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


How reproducible:


Steps to Reproduce:
1. update to udev-113-12
2. plug in a Canon PowerShot A610 (and probably other) USB camera
3. try to access it with gphoto -L or digikam --detect-camera as user
  
Actual results:

gphoto debug relevant lines:

1.037513 gphoto2-port(2): Opening USB port...
1.037624 gphoto2-port(0): Could not query kernel driver of device.
1.037652 gphoto2-port(0): Could not claim interface 0 (A művelet nem engedett).
Make sure no other program or kernel module (such as sdc2xx, stv680, spca50x) is
using the device and you have read/write access to the device.


Expected results:

gphoto -L should auto detect the camera and list the stored files

Additional info:

After googling, I have found that if I modify the file
/etc/udev/rules.d/50-udev.rules it will work.

I made this modification:

 diff 50-udev.rules 50-udev.rules~
274c274
<SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
<       NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0666"
---
>SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", \
>       NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}", MODE="0644"
278c278

<ACTION=="add", SUBSYSTEM=="usb_device", \
        PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i
$${K%%%%.*} $${K#*.
}'", \
<       NAME="%c", MODE="0666"
---
>ACTION=="add", SUBSYSTEM=="usb_device", \
        PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i
$${K%%%%.*} $${K#*.
}'", \
>       NAME="%c", MODE="0644"

So I changed the MODE mask in the usb_device related entries.

I know that it is an unsafe hack, but a temporary solution before you can fix it.

Comment 1 Leonard Evens 2008-01-07 14:25:29 UTC
I have a similar problem.

I am running Fedora Core 7.  With Kernel package 2.6.23.8-34.fc7, the following
rule in a file in /etc/udev/rules.d

KERNEL=="4-1", SUBSYSTEM=="usb", ATTR{product}=="Eye-One display ", ATTR{manufac
turer}=="GretagMacbeth", ATTR{idVendor}=="0971", ATTR{idProduct}=="2003", MODE:=
"0666"

produced the desired mode 0666.  (The actual device created is /dev/bus/usb/004/00x
where 'x' changes, incrementing by 1 each time I plug in the device.)

udevtest produces the following output

main: looking at device '/devices/pci0000:00/0000:00:1d.3/usb4/4-1' from
subsystem 'usb'
udev_rules_get_name: rule applied, '4-1' becomes 'bus/usb/004/003'
udev_db_get_device: found a symlink as db file
udev_device_event: device '/devices/pci0000:00/0000:00:1d.3/usb4/4-1' already in
database, cleanup
udev_node_add: creating device node '/dev/bus/usb/004/003', major=189,
minor=386, mode=0666, uid=0, gid=0
main: run: 'socket:/org/freedesktop/hal/udev_event'
main: run: '/sbin/pam_console_apply /dev/bus/usb/004/003 '
main: run: 'socket:/org/kernel/udev/monitor'

However, the exact same rule under Kernel package 

 fails to change the permissions.   The udevtest output is the same but it
doesn't work.

On the other hand,  I can add OWNER= and GROUP= assignments to the rule and they
are enforced.  It is just the MODE= assignment which fails.  I can use this as a
workaround to get access to the device without becoming root by assigning myself
as OWNER.

In attempting to write a rule which would work, I've also discovered other
anomalies.  For example, using a PROGRAM=..., NAME=%c, MODE=... works in some
cases if the program statement fails but doesn't work if the PROGRAM statement
is modified to work as expected.

I finally found that the following appears to work with kernel package
2.6.23.12-52.fc7
# i1Display
SYSFS{idVendor}=="0971", SYSFS{idProduct}=="2003", MODE:="0666"

which is the simplest way to deal with the problem and obviates the more
complicated syntax tried above.
 

Comment 2 Leonard Evens 2008-01-07 14:27:43 UTC
"However, the exact same rule under Kernel package"  should read

"However, the exact same rule under Kernel package 2.6.23.12-52.fc7"

Comment 3 Bug Zapper 2008-05-14 15:07:39 UTC
This message is a reminder that Fedora 7 is nearing the end of life. Approximately 30 (thirty) days from now Fedora will stop maintaining and issuing updates for Fedora 7. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '7'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 7's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 7 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora please change the 'version' of this bug. If you are unable to change the version, please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. If possible, it is recommended that you try the newest available Fedora distribution to see if your bug still exists.

Please read the Release Notes for the newest Fedora distribution to make sure it will meet your needs:
http://docs.fedoraproject.org/release-notes/

The process we are following is described here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 4 Bug Zapper 2008-06-17 02:54:33 UTC
Fedora 7 changed to end-of-life (EOL) status on June 13, 2008. 
Fedora 7 is no longer maintained, which means that it will not 
receive any further security or bug fix updates. As a result we 
are closing this bug. 

If you can reproduce this bug against a currently maintained version 
of Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


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