Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 153471 - libgphoto2-2.2.1-r1's usbcam sets permissions on the wrong file
Summary: libgphoto2-2.2.1-r1's usbcam sets permissions on the wrong file
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Alastair Tse (RETIRED)
URL:
Whiteboard:
Keywords:
: 153474 (view as bug list)
Depends on:
Blocks:
 
Reported: 2006-10-30 12:31 UTC by Fred Labrosse
Modified: 2006-12-31 14:34 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Backports the idea of the newer udev-rules form libgphoto-svn (libgphoto2-2.2.1-backported-udev-fixes.diff,4.44 KB, patch)
2006-12-08 04:59 UTC, Matthias Schwarzott
Details | Diff
ebuild changes to apply above patch and create udev-rules (libgphoto-2.2.1-udev-ebuild-changes.diff,2.64 KB, patch)
2006-12-08 05:01 UTC, Matthias Schwarzott
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fred Labrosse 2006-10-30 12:31:47 UTC
When I plug my camera "Canon PowerShot A430", the script /etc/hotplug/usb/usbcam changes permissions and group of what is called in it "${DEVICE}".  This happens to be /proc/bus/usb/003/0?? on my machine, while the device that should be modified is /dev/bus/usb/003/0?? (at least this is what gphoto2 is using).  If I manually do what is performed by the script on the "right" device (in /dev), all works fine and I can access my camera as a normal user.  If I let the script do its job, I get:

> strace gphoto2 --summary

<snip>

open("/dev/bus/usb/003/003", O_RDWR)    = -1 EACCES (Permission denied)

<snip>

I have dbus and hal installed and running if that makes a difference.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2006-10-30 12:48:58 UTC
*** Bug 153474 has been marked as a duplicate of this bug. ***
Comment 2 Guillaume Infantes 2006-11-29 03:34:50 UTC
I had the same problem here, everything in /proc seemed ok, but not in /dev, and after some time playing with usbcam script, if seemed that the if branch was not executed because ${DEVICE} was empty. I cannot figure if it was the case before I tried about a hundred different things. As  I dont know were does this $DEVICE come from, I cannot say more...

Comment 3 Gilles Schintgen 2006-12-02 12:09:09 UTC
I've got the same issue. I'm using
sys-fs/udev-103
sys-apps/hotplug-20040923-r2
sys-apps/hotplug-base-20040401
media-libs/libgphoto2-2.2.1-r1
sys-kernel/ck-sources-2.6.17_p1-r3

I removed /etc/hotplug and /etc/hotplug.d before re-emerging it. Is it possible that currently *all* PTP cameras are broken in Gentoo?

Here's hotplug's debugging output when DEBUG is enabled: in /etc/hotplug.d/default/default.hotplug.
Dec  2 21:00:24 somehost kernel: usb 4-1: new full speed USB device using uhci_hcd and address 8
Dec  2 21:00:24 somehost kernel: usb 4-1: configuration #1 chosen from 1 choice
Dec  2 21:00:24 somehost default.hotplug[1655]: arguments (usb) env (SUBSYSTEM=usb DRIVER=usb OLDPWD=/ DEVPATH=/devices/pci0000:00/0000:00:10.2/usb4/4-1 ACTION=add PWD=/etc/hotplug UDEV_LOG=3 UDEVD_EVENT=1 SHLVL=1 PHYSDEVDRIVER=usb DEBUG=yes PHYSDEVBUS=usb SEQNUM=1771 _=/bin/env)
Dec  2 21:00:24 somehost default.hotplug[1655]: invoke /etc/hotplug/usb.agent ()
Dec  2 21:00:24 somehost default.hotplug[1670]: arguments (usb) env (SUBSYSTEM=usb OLDPWD=/ DEVPATH=/devices/pci0000:00/0000:00:10.2/usb4/4-1/4-1:1.0 ACTION=add MODALIAS=usb:v04A9p30F9d0001dc00dsc00dp00ic06isc01ip01 PWD=/etc/hotplug UDEV_LOG=3 UDEVD_EVENT=1 SHLVL=1 DEVICE=/proc/bus/usb/004/008 INTERFACE=6/1/1 PRODUCT=4a9/30f9/1 TYPE=0/0/0 DEBUG=yes PHYSDEVBUS=usb SEQNUM=1772 _=/bin/env)
Dec  2 21:00:24 somehost default.hotplug[1670]: invoke /etc/hotplug/usb.agent ()
Dec  2 21:00:24 somehost usb.agent[1670]: Setup usbcam usbcam usbcam for USB product 4a9/30f9/1
Dec  2 21:00:24 somehost usb.agent[1670]: Module setup usbcam for USB product 4a9/30f9/1
Dec  2 21:00:24 somehost last message repeated 2 times
Dec  2 21:00:24 somehost default.hotplug[1748]: arguments (usb_device) env (PHYSDEVPATH=/devices/pci0000:00/0000:00:10.2/usb4/4-1 SUBSYSTEM=usb_device OLDPWD=/ DEVPATH=/class/usb_device/usbdev4.8 MINOR=391 ACTION=add PWD=/etc/hotplug UDEV_LOG=3 MAJOR=189 UDEVD_EVENT=1 DEVNAME=/dev/bus/usb/004/008 SHLVL=1 PHYSDEVDRIVER=usb DEBUG=yes PHYSDEVBUS=usb SEQNUM=1773 _=/bin/env)
Dec  2 21:00:24 somehost default.hotplug[1748]: no runnable /etc/hotplug/usb_device.agent is installed
Comment 4 Gilles Schintgen 2006-12-02 13:18:44 UTC
Here's a possible fix. I used "/usr/lib/libgphoto2/print-camera-list udev-rules" to create a rules file which I put in /etc/udev/rules.d. Unfortunately this didn't help. So I edited the rules file and changed all the rules to something like
SYSFS{idVendor}=="093a", SYSFS{idProduct}=="010f", GROUP="plugdev", MODE="660"
(setting group and mode instead of running /etc/hotplug/usb/usbcam).
If these rules are called after the default udev rules everything works fine. Just name the rule file "/etc/udev/rules.d/99-gphoto2.rules" to ensure that they are called at the right moment.
Comment 5 Matthias Schwarzott gentoo-dev 2006-12-08 04:59:05 UTC
Created attachment 103620 [details, diff]
Backports the idea of the newer udev-rules form libgphoto-svn

That patch, plus the next ebuild-changes should allow libgphoto-2.2.1 to generate correct udev-rules for udev-0.98 and above (works with udev-103).
Comment 6 Matthias Schwarzott gentoo-dev 2006-12-08 05:01:30 UTC
Created attachment 103621 [details, diff]
ebuild changes to apply above patch and create udev-rules

These ebuild changes apply the before posted patch and also generate udev-rules based on use-flag udev.

It also contains my changes for Bug #147346 as they are closely related.
(It will not work without those LD_LIBRARY_PATH and CAMLIBS magic).
Comment 7 Paolo Pedroni 2006-12-10 15:06:40 UTC
(In reply to comment #6)
> Created an attachment (id=103621) [edit]
> ebuild changes to apply above patch and create udev-rules

Is the RDEPEND on sys-apps/hotplug still necessary?
Comment 8 Matthias Schwarzott gentoo-dev 2006-12-11 08:21:46 UTC
Added patch to ebuild.