[libhid-discuss] [Libusb-devel] permission denied for opening HID device

amruth amruth_pv at yahoo.com
Thu Aug 28 23:20:56 UTC 2008


Hi
I have set up rules in udev. I have 4 hid devices, all them works except one. I did not understand why, but I have done workaround. The issue is that libusb-0.9 expects file in /dev/bus/usb/001/001 to be O_RDWR, and errors out if not the case, so I allowed O_RDONLY in libusb which solves the issue in libusb/os/linux_usbfs.c. I don't understand why libusb always reads from /dev/bus/001/001 instead of /dev/bus/002/001 which is more recent entry. I have removed my device several times but it cached that info of HID device. If I change the permission to allow O_RDONLY, this problem goes away. Please let the dev path having read only permission to use the device. All the permission I set are correct but the caching is issue, we need to disable caching in libusb.

Thanks
Amruth p.v


--- On Thu, 8/28/08, Lou <lou.libusb at fixit.nospammail.net> wrote:

> From: Lou <lou.libusb at fixit.nospammail.net>
> Subject: Re: [Libusb-devel] permission denied for opening HID device
> To: "amruth" <amruth_pv at yahoo.com>
> Cc: "Marian Aldenhoevel" <marian.aldenhoevel at marian-aldenhoevel.de>, "Charles Lepple" <clepple at ghz.cc>, libusb-devel at lists.sourceforge.net, "libhid-discuss List" <libhid-discuss at lists.alioth.debian.org>
> Date: Thursday, August 28, 2008, 1:58 PM
> On Tue, Aug 26, 2008 at 05:32:33PM -0700, amruth wrote:
> > Hi
> > I am using libusb-0.9.2 and libcompat-0.1-beta with
> libhid-0.1.
> > I am facing this problem whenever I am trying to open
> my HID device.
> > libusb is always trying to open from
> > libusb could'nt open USB device
> /dev/bus/usb/001/001 permission denied.
> > I have unplugged the HID device several times but
> libusb is always trying open from /dev/bus/usb/001/001
> location. Please let me know if anybody has any idea.
> 
> That is a basic permissions problem.  Look at the
> permissions on that
> node.  Some folks run their libusb app as root to get
> around that, but
> that's obviously a security problem.
> 
> A better measure will vary by OS.  My system uses udev, so
> I created a
> udev rule that sets permissions to something else (which I
> can access as a
> normal user) when that node is created for my particular
> device.


      




More information about the libhid-discuss mailing list