Bug 189936 - Access to USB camera only as root user
Summary: Access to USB camera only as root user
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gphoto2
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Radek Vokál
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-04-25 21:54 UTC by Richard Körber
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version: 2.1.99-14
Clone Of:
Environment:
Last Closed: 2006-06-07 18:29:37 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Richard Körber 2006-04-25 21:54:22 UTC
Description of problem:
I connect a Canon EOS 300D by USB. When trying to access the camera as normal
user, I get an error message saying that the USB device could not be opened.
When I try this as root, it is working fine though.


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


How reproducible:
Always


Steps to Reproduce:
1. Connect a digital camera (e.g. Canon EOS 300D) by USB
2. Try "gphoto2 -L" as normal user

  
Actual results:
I get the following error message:

*** Fehler ***
Ein Fehler trat in der IO-Bibliothek auf (»Konnte das USB-Gerät nicht
beanspruchen«): Konnte Schnittstelle 0 nicht reservieren (Die Operation ist
nicht erlaubt). Stellen Sie sicher, dass kein
anderes Programm oder Kernelmodul (z.B. sdc2xx, stv680, spca50x) das Gerät
verwendet und Sie
Lese- und Schreibrechte für das Gerät haben.
*** Fehler (-53: »Konnte das USB-Gerät nicht beanspruchen«) ***

Quick translation: "Could not claim USB device: Could not reserve device 0
(operation is not permitted)." ... "Error (-53: Could not claim USB device)"


Expected results:
Access to the camera. When I invoke "gphoto2 -L" as root, everything is as expected.


Additional info:
I assume that udev does not set proper rights to the USB device. There is no
kind of "gphoto2.rules" file in "/etc/udev/rules.d". I have tried the following
lines as "/etc/udev/rules.d/70-gphoto.rules":

# Canon EOS Kiss Digital (normal mode)
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="3084", MODE="0666"
# Canon EOS Kiss Digital (PTP mode)
SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="3099", MODE="0666"

After that, gphoto2 was working as expected, even for a normal user.

Comment 1 Radek Vokál 2006-04-26 11:12:11 UTC
Can you try gphoto2-2.1.99-10 from rawhide? I did some fixes inside gphoto2
config scripts. Hal takes care of permissions, so this is not a udev rule
problem, but probably hal rule problem. 

Comment 2 Richard Körber 2006-04-26 16:27:32 UTC
Tried gphoto2-2.1.99-10, but it's still unchanged.

Comment 3 Andreas Heik 2006-06-07 14:03:37 UTC
There is a simple mismatch into hal-files from gphoto2-package:

/usr/share/hal/fdi/information/20thirdparty/10-camera-libgphoto2.fdi
is generated via /usr/lib/libgphoto2/print-usb-usermap --fdi.
This command create for every supported camera a entry with 
<merge key="camera.access_method" type="string">proprietary</merge>
but in the hal-policy-file
/usr/share/hal/fdi/policy/20thirdparty/90-gphoto-camera-policy.fdi
is no match for 
<match key="camera.access_method" string="proprietary"> defined.

Here is a diff with my  90-gphoto-camera-policy.fdi:

--- /usr/share/hal/fdi/policy/20thirdparty/90-gphoto-camera-policy.fdi.orig    
2006-06-07 15:50:30.000000000 +0200
+++ /usr/share/hal/fdi/policy/20thirdparty/90-gphoto-camera-policy.fdi 
2006-06-07 15:50:52.000000000 +0200
@@ -4,7 +4,7 @@

   <device>
     <match key="info.capabilities" contains="camera">
-      <match key="camera.access_method" string="libgphoto2">
+      <match key="camera.access_method" string="proprietary">
         <append key="info.callouts.add"
type="strlist">/usr/libexec/gphoto-set-procperm</append>
       </match>
       <match key="camera.access_method" string="ptp">

Comment 4 Radek Vokál 2006-06-07 18:29:37 UTC
Thanks, I've applied your patch on rawhide. Strange that this was all the time
working for me .. 

Comment 5 Andreas Heik 2006-06-08 06:43:49 UTC
I think your camera runs in ptp-mode. And there is another match in the
90-gphoto-camera-policy.fdi.


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