Access rights for specific USB device in /dev?

Test Rat ttsestt at gmail.com
Wed Aug 3 03:08:42 UTC 2011


Lev Serebryakov <lev at FreeBSD.org> writes:

> Hello, Freebsd-usb.
> You wrote 3 августа 2011 г., 2:37:09:
>
>>   Now I have another question: devfs(8) uses device types or paths to
>> specify access rules for /dev/*, which is bad idea for USB device, as
>> it will change path when cable will be re-attached to another port. Is
>> here any method to set owner:group of device node by VID/PID or ID
>> string or something like this?
>  I've tried to add "attach" rule to devd.conf, but here is one
> problem: $device-name is "ugen1.2" for example, and "devfs" change
> owner and permissions on /dev/ugen1.2, but it is only "symbolic link"
> and real device is "/dev/usb/1.2.0" in such case -- as result, owner
> and permissions on real device stay unchanged and "blazer_usb" can not
> access it again :(

Why not apply chown(8) from devd.conf then?

notify 0 {
	match "subsystem" "DEVICE";
	match "type" "ATTACH";
	match "cdev" "ugen[0-9]+.[0-9]+";

	match "vendor" "0xfoo"
	match "product" "0xbar"

	action "chown owner:group /dev/$cdev";
};


More information about the freebsd-usb mailing list