Bug #5542
devfsadm fails to set usb child device permissions per /etc/minor_perm
0%
Description
Upon installing a USB HID device (using ugen), the following /devices entries are seen:
root@sanbox:/devices/pci@0,0/pci15d9,803@1d/hub@1# ls al 1 root root 198, 2 Jan 15 17:01 input@5:50d.751.cntrl0
total 17
drwxr-xr-x 5 root sys 27 Dec 18 16:07 .
drwxr-xr-x 3 root sys 3 Dec 16 20:14 ..
drwxr-xr-x 2 nut sys 2 Dec 18 15:26 input@5
crw------
crw------- 1 root root 198, 3 Dec 18 16:07 input@5:50d.751.cntrl0stat
crw------- 1 root root 198, 1 Dec 18 16:07 input@5:50d.751.devstat
crw------- 1 root root 198, 4 Dec 18 16:07 input@5:50d.751.if0in1
crw------- 1 root root 198, 5 Dec 18 16:07 input@5:50d.751.if0in1stat
The USB device was linked to the ugen driver with the following command:
add_drv -i '"usb50d,751.1"' -m '* 0666 nut sys' ugen
The /etc/minor_perm file contains the entry:
ugen:* 0666 nut sys
The file /etc/driver_aliases contains the entry:
ugen "usb50d,751.1"
The problem is that the child device entries created by ugen are not inheriting the permissions of the parent device, "input@5".
This, in turn, prevents my service running as the user "nut" from being able to access the device.
My ugly workaround is to execute "chown nut:sys /devices/pci@0,0/pci15d9,803@1d/hub@1/input@5*" at each service start, which clearly breaks the ability to move the device from one usb port to another.