Hi People,
I am working on a program that communicates with hardware using LibUSB and LibFTDI. When I run the program as root, everything is fine and the devices are accessed. When I run the user as my development user (in the admin group), the program cannot access connected hardware.
This actually caused a problem for a week as I thought something was wrong with either the libraries or my code which resulted in me spending a lot of time looking at the source of LibUSB and LibFTDI.
Part of this program does something similar to USBConfig which requires elevated permissions on my development system to run.
I went down the BPF (Berkeley Packet Filter) rabbit hole but I either missed something or do not see how this affects access.
Since this program is to be used by regular users with few rights, I would like to know what group(s) I have to add users to in order to access hardware via LibUSB and LibFTDI. I have not seen ... or I don't recall anything that specifically talks about this.
Both my development user and the root user are members of the wheel and operator groups.
The end goal is for my development account to run the program normally (which includes debugging) and the regular user accounts to be able to run the program normally.
What groups should I research more? What do I have to learn about accessing hardware?
so much to learn, so little time.
I have been working long hours and sleeping not long hours for a bit. I hope my question is clear enough.
=thoth=
I am working on a program that communicates with hardware using LibUSB and LibFTDI. When I run the program as root, everything is fine and the devices are accessed. When I run the user as my development user (in the admin group), the program cannot access connected hardware.
This actually caused a problem for a week as I thought something was wrong with either the libraries or my code which resulted in me spending a lot of time looking at the source of LibUSB and LibFTDI.
Part of this program does something similar to USBConfig which requires elevated permissions on my development system to run.
Code:
Predator: LPOCheck: usbconfig
No device match or lack of permissions.
Predator: LPOCheck: sudo usbconfig
ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
ugen0.3: <Logitech USB Receiver> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (98mA)
...
Predator: LPOCheck: usbdump
usbdump: Could not open BPF device: Permission denied
Predator: LPOCheck: ktrace usbdump
usbdump: Could not open BPF device: Permission denied
Predator: LPOCheck: sudo ktrace usbdump
18:03:00.459840 usbus0.5 SUBM-ISOC-EP=00000003,SPD=FULL,NFR=32,SLEN=0,IVAL=0
18:03:00.459842 usbus0.5 DONE-ISOC-EP=00000003,SPD=FULL,NFR=32,SLEN=0,IVAL=0,ERR=0
...
Since this program is to be used by regular users with few rights, I would like to know what group(s) I have to add users to in order to access hardware via LibUSB and LibFTDI. I have not seen ... or I don't recall anything that specifically talks about this.
Both my development user and the root user are members of the wheel and operator groups.
The end goal is for my development account to run the program normally (which includes debugging) and the regular user accounts to be able to run the program normally.
What groups should I research more? What do I have to learn about accessing hardware?
so much to learn, so little time.
I have been working long hours and sleeping not long hours for a bit. I hope my question is clear enough.
=thoth=