Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-11-12 Thread Hendrik Naumann
Hi Marco

I did some investigations into the libphoto2 udev rules issue, maybe 
this helps you finding a solution. (I am using udev 0.100-2.2, 
libgphoto2-2 2.2.1-10, kernel 2.6.18-2-686 2.6.18-4)

The camera I use here is an older one (HP Photosmart R507) which used 
to work with sarge and hotplug. Which means a lot of cameras where no 
explicit vendorid .. is provided, will not be supported only because 
the devices does not get the right groups. :(

Am Mittwoch, 1. November 2006 19:52 schrieb Frederic Peters:
> md wrote:
> > > How would you reformat those ?
> >
> > Then they are fine.
>
> Sorry to bother you again, but there is still one problem; consider
> this rules file:
>
>   ACTION!="add", GOTO="libgphoto2_rules_end"
>   SUBSYSTEM=="usb_device", GOTO="libgphoto2_rules_real"
>   SUBSYSTEM=="usb", GOTO="libgphoto2_rules_real"
>   BUS!="usb", GOTO="libgphoto2_rules_end"
>
>   LABEL="libgphoto2_rules_real"

If I comment out the above lines, the following devices get the 
plugdev group  

/dev/usbdev2.7_ep81
/dev/usbdev2.7_ep01
/dev/usbdev2.7_ep82

but not /dev/bus/usb/002/007 which is used to get access to the 
photos.

>   SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="30fd", \
> MODE="0660", GROUP="plugdev"
>
>   SYSFS{bInterfaceClass}=="06", SYSFS{bInterfaceSubClass}=="01", \
> SYSFS{bInterfaceProtocol}=="01", \
> MODE="0660", GROUP="plugdev"
>
>   LABEL="libgphoto2_rules_end"
>
>
> It will match my camera on its USB ID and it will work fine.
>
> What I would like to achieve would be that if a specific USB ID
> can't be matched, at least there is a generic rule matching 'PTP
> camera' and it works without adding a new rule.
>
> Unfortunately the rule as it is written now doesn't work, could you
> enlighten me on this, how can I match against bInterface* when a
> camera is plugged ?

With the rules provided in libgphoto2-2 no device gets the plugdev 
group.

Hendrik

-- 
PGP ID 65C92061

Bus 002 Device 007: ID 03f0:6e02 Hewlett-Packard 
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0 
  bDeviceProtocol 0 
  bMaxPacketSize064
  idVendor   0x03f0 Hewlett-Packard
  idProduct  0x6e02 
  bcdDevice0.01
  iManufacturer   1 HEWLETT-PACKARD 
  iProduct2 HP PhotoSmart R507 Camera 
  iSerial 3 LCN48BB602B0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   39
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0 
bmAttributes 0xc0
  Self Powered
MaxPower   10mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   3
  bInterfaceClass 6 Imaging
  bInterfaceSubClass  1 Still Image Capture
  bInterfaceProtocol  1 Picture Transfer Protocol (PIMA 15470)
  iInterface  0 
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01  EP 1 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0010  1x 16 bytes
bInterval 255
Device Status: 0x0001
  Self Powered


pgpOZNCK7TcBr.pgp
Description: PGP signature


Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-11-01 Thread Frederic Peters
md wrote:

> > How would you reformat those ?
> Then they are fine.

Sorry to bother you again, but there is still one problem; consider
this rules file:

  ACTION!="add", GOTO="libgphoto2_rules_end"
  SUBSYSTEM=="usb_device", GOTO="libgphoto2_rules_real"
  SUBSYSTEM=="usb", GOTO="libgphoto2_rules_real"
  BUS!="usb", GOTO="libgphoto2_rules_end"
  
  LABEL="libgphoto2_rules_real"
  
  SYSFS{idVendor}=="04a9", SYSFS{idProduct}=="30fd", \
MODE="0660", GROUP="plugdev"
  
  SYSFS{bInterfaceClass}=="06", SYSFS{bInterfaceSubClass}=="01", \
SYSFS{bInterfaceProtocol}=="01", \
MODE="0660", GROUP="plugdev"
  
  LABEL="libgphoto2_rules_end"
  

It will match my camera on its USB ID and it will work fine.

What I would like to achieve would be that if a specific USB ID can't
be matched, at least there is a generic rule matching 'PTP camera' and
it works without adding a new rule.

Unfortunately the rule as it is written now doesn't work, could you
enlighten me on this, how can I match against bInterface* when a
camera is plugged ?


Thanks,

Frederic


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-11-01 Thread md
On Nov 01, Frederic Peters <[EMAIL PROTECTED]> wrote:

> How would you reformat those ?
Then they are fine.

-- 
ciao,
Marco


signature.asc
Description: Digital signature


Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-11-01 Thread Frederic Peters
Hi Marco,

> > So maybe this is an udev bug?
> I highly doubt this. Keep investigating.
> Also, you really really want to add other parameters (e.g. a SUBSYSTEM
> key) or these rules will be matched against *everything* and will try to
> open files in sysfs for every event.

libgphoto2.rules starts with this:

ACTION!="add", GOTO="libgphoto2_rules_end"
SUBSYSTEM=="usb_device", GOTO="libgphoto2_rules_real"
SUBSYSTEM=="usb", GOTO="libgphoto2_rules_real"
BUS!="usb", GOTO="libgphoto2_rules_end"

LABEL="libgphoto2_rules_real"

And then come the individual rules, matching idVendor and idProduct.  And
occasionnaly bInterfaceClass, bInterfaceSubClass and bInterfaceProtocol.

How would you reformat those ?


Thanks,

Frederic


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-11-01 Thread md
On Nov 01, Hendrik Naumann <[EMAIL PROTECTED]> wrote:

> So maybe this is an udev bug?
I highly doubt this. Keep investigating.
Also, you really really want to add other parameters (e.g. a SUBSYSTEM
key) or these rules will be matched against *everything* and will try to
open files in sysfs for every event.

-- 
ciao,
Marco


signature.asc
Description: Digital signature


Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-10-31 Thread Hendrik Naumann
Hi

Sorry for the delayed answer.

> Could you try 2.2.1-7; Fuji F30 was added in this version.

Yes with this version it works.

But it seems that the hotplug rules of libgphoto2 are better than the 
udev rules, because sarge can handle this camera. So any PTP camera 
released after etch will not work with etch but with sarge?

To my understanding the rule 

SYSFS{bInterfaceClass}=="06", SYSFS{bInterfaceSubClass}=="01",\ 
SYSFS{bInterfaceProtocol}=="01", MODE="0660", GROUP="camera"

should match. When I connect the camera

/sys/bus/usb/devices/1-8/1-8:1.0

contains bInterfaceClass, bInterfaceSubClass, bInterfaceProtocol with 
the correct entries.

So maybe this is an udev bug?

I experimented a bit and at least the rule

SYSFS{product}=="USB PTP Camera", MODE="0660", GROUP="camera"

matches as well and gives the right permissions. I am not shure if 
this rule is as global as the not working (bInterfaceClass ...) one.
Maybe this problem can be forwarded to upstream as well?

Thanks 

Hendrik Naumann

-- 
PGP ID 65C92061


pgpRLq3q1rcQd.pgp
Description: PGP signature


Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-10-23 Thread Frederic Peters
Hendrik Naumann wrote:

> > Which version of libgphoto2 are you using ?
> 
> dpkg --status libgphoto2-2
> Version: 2.2.1-4

Could you try 2.2.1-7; Fuji F30 was added in this version.


Thanks,
Frederic


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-10-22 Thread Hendrik Naumann
Hi

> Which version of libgphoto2 are you using ?

dpkg --status libgphoto2-2
Version: 2.2.1-4

I think the udev config stuff is as the package provided it.

> What is the output of
>   ls -l /etc/udev/rules.d/025_libgphoto2.rules

lrwxrwxrwx 1 root root 19 2006-07-19 16:41 
/etc/udev/rules.d/025_libgphoto2.rules -> ../libgphoto2.rules

> and
>   ls -l /etc/udev/025_libgphoto2.rules

I think it should be ls -l /etc/udev/libgphoto2.rules

-rw-r--r-- 1 root root 45480 2006-10-19 20:55 /etc/udev/libgphoto2.rules

I am not very much into udev rules.  lsusb provides the following infos

...
 bInterfaceClass 6 Imaging
  bInterfaceSubClass  1 Still Image Capture
  bInterfaceProtocol  1 Picture Transfer Protocol (PIMA 15470)
...

and this rule from /etc/udev/libgphoto2.rules should match it

SYSFS{bInterfaceClass}=="06", SYSFS{bInterfaceSubClass}=="01", 
SYSFS{bInterfaceProtocol}=="01", MODE="0660", GROUP="camera"

But find "/dev -group camera" does not find any device file.

> Your model should be recognised and udev, working properly, should
> set device group appropriately.

I think the device is too new. At least gphoto2 --list-cameras does 
not list it. But it works perfectly on a sarge (using hotplug) system 
as normal user.

> If it is possible for you, you should also use something else than
> digikam for debugging this problem since it has currently some
> issues.

I also tried with gtkam. Works as root, does not as user in group 
camera.

By the way is straced digikam. The last accessed device when failing
access the camera is /dev/bus/usb/001/005

12872 open("/dev/bus/usb/001/005", O_RDWR) = -1 EACCES (Permission denied)
12872 open("/dev/bus/usb/001/005", O_RDONLY) = 19
12872 ioctl(19, USBDEVFS_GETDRIVER, 0xa5994938) = -1 EPERM (Operation not 
permitted)
12872 ioctl(19, USBDEVFS_CLAIMINTERFACE, 0xa5994a54) = -1 EPERM (Operation not 
permitted)
12872 munmap(0xa3c3c000, 138608)= 0
12872 ioctl(19, USBDEVFS_RELEASEINTERFACE, 0xa59962a4) = -1 EPERM (Operation 
not permitted)
12872 munmap(0xa3c5e000, 12688) = 0
12872 munmap(0xa3cb7000, 32024) = 0
12872 ioctl(5, FIONREAD, [0])   = 0

ls -l /dev/bus/usb/001/005 gives
crw-rw-r-- 1 root root 189, 4 2006-10-22 21:26 /dev/bus/usb/001/005

When lsusb gives
Bus 002 Device 001: ID :
Bus 003 Device 001: ID :
Bus 004 Device 001: ID :
Bus 005 Device 001: ID :
Bus 001 Device 005: ID 04cb:019b Fuji Photo Film Co., Ltd
Bus 001 Device 001: ID :


-- 
PGP ID 65C92061


pgphQkM9Wa5lA.pgp
Description: PGP signature


Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-10-22 Thread Frederic Peters
severity 394684 normal
retitle 394684 permission problem wrt Fuji Finepix F30
thanks

Which version of libgphoto2 are you using ?

What is the output of
  ls -l /etc/udev/rules.d/025_libgphoto2.rules 
and
  ls -l /etc/udev/025_libgphoto2.rules 

Your model should be recognised and udev, working properly, should set
device group appropriately.

If it is possible for you, you should also use something else than
digikam for debugging this problem since it has currently some issues.


Thanks,
Frederic


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Bug#394684: libgphoto-2: privilege problem with PTP mode camera

2006-10-22 Thread Hendrik Naumann
Package: libgphoto-2
Severity: important

*** Please type your report below this line ***
My camera Fuji Finepix F30 works in USB PTP mode. While I can access 
the photos (via digikam) on the camera as root I can not as normal 
user, allthough I am a member of group camera. 

I am using udev and kernel 2.6.16-2-686.

I think this is a quite severe problem because most new cameras are 
only suported in PTP mode. 

I attached the output of lsusb -v 

Hendrik Naumann

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (500, 'testing'), (20, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.16-2-686
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15) 
(ignored: LC_ALL set to [EMAIL PROTECTED])

-
lsusb shows

Bus 001 Device 003: ID 04cb:019b Fuji Photo Film Co., Ltd
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize064
  idVendor   0x04cb Fuji Photo Film Co., Ltd
  idProduct  0x019b
  bcdDevice1.00
  iManufacturer   0
  iProduct2 USB PTP Camera
  iSerial 3 592D313130300605277B43303011EA
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   39
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0
bmAttributes 0xc0
  Self Powered
MaxPower   50mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   3
  bInterfaceClass 6 Imaging
  bInterfaceSubClass  1 Still Image Capture
  bInterfaceProtocol  1 Picture Transfer Protocol (PIMA 15470)
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01  EP 1 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x83  EP 3 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0020  1x 32 bytes
bInterval  11
Device Qualifier (for other device speed):
  bLength10
  bDescriptorType 6
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize064
  bNumConfigurations  1
Device Status: 0x0001
  Self Powered



-- 
PGP ID 65C92061


pgptPSoV4u4py.pgp
Description: PGP signature