Replies: 2 comments 2 replies
-
Yes, the system can protect devices against non-privileged user access. It is the same as you cannot usually do "echo hello > /dev/sda1". So if you don't have write access to the device node /dev/bus/usb/xxx/yyy you cannot send control transfers to request device details. The kernel has however already retrieved and cached some of this information, so you can find them under /sys/bus/usb/devices . There are some ideas about enhancing libusb to report these values without the user having to open the device, see #1258. |
Beta Was this translation helpful? Give feedback.
-
You can also take a look at how lsusb uses libudev to collect information from the system HW database. https://github.com/gregkh/usbutils/blob/master/names.c |
Beta Was this translation helpful? Give feedback.
-
Coming from "https://libusb.info/", which states:
However, when running
hotplugtest
and insert/eject a USB storage (simple USB mass storage pen drive, 32GB) I get the following:$> ./hotplugtest
Device detached: 0951:1621
Device attached: 0951:1621
No access to device: Access denied (insufficient permissions)
Is it expected to require root privileges (under Linux) to request device details like Manufacturer, Vendor, Product, SerialNumber?
Running under Ubuntu 22.04LTS.
Kernel 6.5.0-35
libusb from "libusb-1.0.27.tar.bz2"
Beta Was this translation helpful? Give feedback.
All reactions