I have a simple command line binary written in C on Debian that reads USB gamepad input on /dev/input/eventX and shows which gamepad buttons are pressed. I do this by opening and reading /dev/input/eventX (whichever node has the gamepad). It works fine, without root, when:
- The X server is launched by lightdm
- Using a local tty (not ssh) using ctrl+alt F1
Problem is, if I disable lightdm and launch the X server manually using xinit (using the default xterm), I do not have permission to access anything in /dev/input/eventX when using xterm. This isn't a problem when lightdm is responsible for launching X, or when using a text-based tty locally.
I am not using a window manager.
Doing ls -l shows special ACL permissions (+) for the gamepad devices. So if a normal user on a tty can read this device, why can't X programs launched under the X server running under the same user account access the devices:
crw-rw----+ 1 root input 13, 67 Jul 31 19:13 event3
Why is this? Why the difference in permissions if using the local text console (i.e. ctrl+alt F1,F2,etc) vs xterm?