Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: [SOLVED] Hardy - USB Device Permissions

  1. #1
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,438
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink [SOLVED] Hardy - USB Device Permissions

    I had put the following 2 lines in my 40-permissions.rules file in 7.04 and 7.10 to allow non-root access to the 2 devices. I let the upgrade to Hardy replace the file so I would have the newest. Now there doesn't appear to be a place for them in 40-permission.rules, but I did see the 40-basic-permissions.rules is in the format of the old file so I added the devices there in the USB fs section. Still no go - I have to be root to access the devices. Can someone explain what has changed and where these statements need to go now?

    Thanks!

    SUBSYSTEM=="usb_device", SYSFS{idVendor}=="0dca", SYSFS{idProduct}=="0027",
    MODE="0666"
    SUBSYSTEM=="usb_device", SYSFS{idVendor}=="167b", SYSFS{idProduct}=="0101", MODE="0666"

  2. #2
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,438
    Distro
    Ubuntu 12.04 Precise Pangolin

    Wink Re: Hardy - USB Device Permissions

    Any ideas?

    Thanks!

  3. #3
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,438
    Distro
    Ubuntu 12.04 Precise Pangolin

    Question Re: Hardy - USB Device Permissions

    Can anyone help me on this or at least direct me to some documentation that might explain this. It appears that the 40-permissions.rules file changed and I no longer know where these assignments should go.

  4. #4
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,438
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hardy - USB Device Permissions

    Please excuse the bump, but perhaps someone has come online now that may know that answer.

  5. #5
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,438
    Distro
    Ubuntu 12.04 Precise Pangolin

    Exclamation For one of the moderators or a guru please

    I have the following post open for which I have not gotten a solution. This is something that worked in Feisty and Gutsy but for some reason doesn't seem to work in Hardy. It deals with the permission files in the /etc/udev/rules.d directory.

    There must be a solution to what I need to do in Hardy, unfortunately no one seems to know.

    Help?

    http://ubuntuforums.org/showthread.p...80#post4897880


    EDIT: BTW for standard Debian, I was told the lines mentioned go in the 20-permissions.rules file, but there is no such file in Ubuntu.
    Last edited by anewguy; May 9th, 2008 at 03:46 AM. Reason: Addition

  6. #6
    Join Date
    Nov 2005
    Location
    NEK Vermont
    Beans
    Hidden!
    Distro
    Ubuntu UNR

    Re: For one of the moderators or a guru please

    Looked at your thread. MODE=0666. Those are your permissions.
    There are no execute permissions there. That might be part of the problem.

    Permissions, in order are U=user G=group O=other.

    Read=4 Write=2 Execute=1

    0666= user/rw group/rw other/rw

    Also consider launchpad as a resource for troubleshooting: https://launchpad.net/
    Last edited by spiderbatdad; May 9th, 2008 at 04:22 AM.

  7. #7
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Hardy - USB Device Permissions

    Threads merged. I know it is frustrating sometimes, but please be patient.

    We have an unanswered team and if you bump your own threads there is no way for them to find your problem as unanswered.

    Also please do not start multiple threads on the same topic, it only makes more work and causes confusion.
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  8. #8
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,438
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hardy - USB Device Permissions

    Sorry everyone - I didn't mean to make anyone upset, so I am sorry. I just couldn't figure out why this worked in Feisty and Gutsy but not in Hardy. I guess I also don't get why the permissions worked in those 2 but not in Hardy, except to say I don't need to execute the USB device - I need to read it via calls in libusb. So I wouldn't think I'd need execute permissions on a device.

    The program in question is now a GUI'd application using GTK (I just finished that), where as the old was a command line application. But I know that makes no difference - especially considering the old command line application will not access the USB device now either unless it is run via sudo.

    Bohdi.Zazen - what's the status now? Do I wait to see if someone has any ideas, and if so, how, or is there a legit problem in the way the permissions are being handled in Hardy (perhaps a change to libusb in some way?).

    Again, sorry.

  9. #9
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: Hardy - USB Device Permissions

    I am not understanding your problem. USB devices auto mount for me here ...

    What device are you trying to configure or what is it about permissions that you feel needs changing ?
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  10. #10
    anewguy is offline I Ubuntu, Therefore, I Am
    Join Date
    Jun 2007
    Location
    Sometimes I visit earth
    Beans
    5,438
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Hardy - USB Device Permissions

    I have a few "special" USB cameras - CVS one-time use camcorders and a CVS one-time use digital still camera hacked for reuse as per camerahacking.com. The 2 lines mentioned earlier for 40-permissions.rules were needed in Feisty and Gutsy so that someone other than root could access them. These cameras don't use standard drivers or communications protocols for digital cameras - hence the use low-level usb calls to libusb to do it. For the still camera, it has to be in bulk-write and bulk-read mode on USB endpoints for the device. There is also a "key" exchange at the beginning to unlock the camera or camcorder before any further conversation with the device can take place.

    By default, when these devices get mounted, they are visible apparently by all users:

    dave@dave-desktop:~/cvsdownload$ lsusb
    Bus 004 Device 010: ID 167b:0101 <== the camcorder
    Bus 004 Device 004: ID 03f0:7604 Hewlett-Packard Deskjet 3940


    dave@dave-desktop:~/cvsdownload$ sudo lsusb
    Bus 004 Device 010: ID 167b:0101 <== the camcorder
    Bus 004 Device 004: ID 03f0:7604 Hewlett-Packard Deskjet 3940
    Bus 004 Device 003: ID 050d:705c Belkin Components
    Bus 004 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
    Bus 004 Device 001: ID 0000:0000
    Bus 003 Device 001: ID 0000:0000
    Bus 002 Device 001: ID 0000:0000
    Bus 001 Device 002: ID 045e:0053 Microsoft Corp.
    Bus 001 Device 001: ID 0000:0000
    dave@dave-desktop:~/cvsdownload$

    Again, as a normal user:

    dave@dave-desktop:~/cvsdownload$ lsusb -v

    Bus 004 Device 010: ID 167b:0101
    Device Descriptor:
    bLength 18
    bDescriptorType 1
    bcdUSB 2.00
    bDeviceClass 0 (Defined at Interface level)
    bDeviceSubClass 0
    bDeviceProtocol 0
    bMaxPacketSize0 64
    idVendor 0x167b
    idProduct 0x0101
    bcdDevice 0.00
    iManufacturer 1
    iProduct 2
    iSerial 3
    bNumConfigurations 1
    Configuration Descriptor:
    bLength 9
    bDescriptorType 2
    wTotalLength 39
    bNumInterfaces 1
    bConfigurationValue 1
    iConfiguration 0
    bmAttributes 0x80
    (Bus Powered)
    MaxPower 96mA
    Interface Descriptor:
    bLength 9
    bDescriptorType 4
    bInterfaceNumber 0
    bAlternateSetting 0
    bNumEndpoints 3
    bInterfaceClass 0 (Defined at Interface level)
    bInterfaceSubClass 0
    bInterfaceProtocol 0
    iInterface 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x01 EP 1 OUT
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x81 EP 1 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    Endpoint Descriptor:
    bLength 7
    bDescriptorType 5
    bEndpointAddress 0x83 EP 3 IN
    bmAttributes 2
    Transfer Type Bulk
    Synch Type None
    Usage Type Data
    wMaxPacketSize 0x0200 1x 512 bytes
    bInterval 0
    can't get device qualifier: Operation not permitted
    can't get debug descriptor: Operation not permitted
    cannot read device status, Operation not permitted (1)

    Notice it permit the last operations - I assume because it's trying to actually "read" the device, and the device requires unlocking by the "key" first.


    However, when the program tries to open and claim the USB device (again via libusb) it fails. Change to "sudo" and it works fine. The above mentioned lines were all that were needed before to let a "normal" user open and claim the device. That no longer works in Hardy - it's as if it's ignoring the permissions some how. Since I have added the lines to 40-basic-permissions.rules, which should do the same as before but makes no difference, perhaps something changed in the usb development library(ies). With Hardy, I have libusb-0.1-4 and libusb-dev installed.

    All I know is that with Feisty and Gutsy, via 40-permissions.rules, the USB devices where given 664 permissions. When the 2 lines were added saying for this particular device from this particular vendor change the permissions to 666, everything worked.

    In Hardy, those permissions appear to now need to be set in 40-basic-permissions.rules, and even at that have no effect - I must be a root user to open and claim the device.

    Hope that helps explain it.

    EDIT: BTW, needless to say running as "sudo" seems (A) require the command line and (B) gives root ownership to the directory and files created by the application when it downloads videos or pictures. This makes for a mess in the users' directory.
    Last edited by anewguy; May 9th, 2008 at 06:01 AM. Reason: addition

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •