This may be a weird question… but I’m interested in learning.
Under /dev/bus/usb, this is how some of the USB “blocks” look:
user1@linux-rvmu:~> ls -lah /dev/bus/usb/002
total 0
drwxr-xr-x 2 root root 100 Jan 16 15:06 .
drwxr-xr-x 4 root root 80 Jan 16 09:14 ..
crw-rw-r-- 1 root root 189, 128 Jan 16 09:14 001
crw-rw-r-- 1 root root 189, 129 Jan 16 09:14 002
crw-rw-r-- 1 root root 189, 130 Jan 16 09:14 003
user1@linux-rvmu:~>
When plugging a USB stick just one more file “004” is added, with exact same data.
I see these devices have permissions 554, owned only by root. But I have seen in other distributions (Debian and Fedora for example, IIRC) that these same devices have additionally extended ACLs, giving the current logged-in user rw permissions.
Why isn’t this the case with openSUSE? Just distribution’s policies?
It probably doesn’t matter. These devices would normally be accessed only by root.
If I plug in a flash drive, root can mount the drive. After that, I depend on permissions for the mounted file system, rather than permissions for the raw device. The file system driver is accessing the device, but I am only accessing file system via the driver.
It might matter if you are accessing the device on a virtual machine, and you are running the virtual machine software as a non-root user.
I am not sure I understand this and am not sure why these device files are created in the first place. I understand it might be logical to have them in case reading/writing directly to the dvice is needed. But when is that the case?
If the USB device is mass storage, there are also device files for mass storage like /dev/sdX, when applicable for the partitions like /dev/sdXN and others in /dev/disk/by-* created. And after that there os no difference between USB mass-storage and other mass-storage.
When they are asynchrounous communicatin devices, they will get device files in the /dev/tty ranges and be usable through those. A Wifi dongle will also be a wlan device, etc.
So wat is the use for these? Maybe only to read USB device information from it needed by udev, etc. to classify the device. But that is typical a root action. And what to write to it?
Thus, maybe when you can define actions which might be usefull to be done by “the current logged-in user” (what when there are more then one current loggged in users?), we can try to understand the ideas behind this not being allowed by default in openSUSE.