Project

General

Profile

Bug #5542

devfsadm fails to set usb child device permissions per /etc/minor_perm

Added by Warren V about 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
2015-01-16
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

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
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------
1 root root 198, 2 Jan 15 17:01 input@5:50d.751.cntrl0
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.

Also available in: Atom PDF