Am Mi, Mär 05, 2025 am 08:30:44 -0000 schrieb Grant Edwards:
I'm working on an application that allows you to remap/mix/reconfigure
the channels/buttons on a USB joystick/game-controller device. That
requires access to /dev/uinput which is used to create a "synthetic"
joystick device and feed data to it.

On Gentoo /dev/uinput is accessible only to root.

   $ ls -l /dev/uinput
   crw------- 1 root root 10, 223 Mar  5 09:36 /dev/uinput

What's the best way to make that available to specific users?

Add a "uinput" group, change the group of /dev/uinput to "uinput",
chmod g+wr, then make specific users part of that group?

That’s a way to do that, probably the easiest. If you go that way, you might want to write that as part of your device manager rules, probably udev.

I’ve noticed recently on a Debian system, that /dev/hidraw* devices were root:root 0600, but the one for my yubikey had an acl on it that gave my user write access. This acl was set by elogind at login time (the idea being that only the user behind the screen should be able to read from that device at any time).

That could be another way to do that, although in your case the security implications are probably not the same as for sensitive devices like yubikeys and as such may not require such a setup.

Reply via email to