I’ve been writing some code that creates a virtual input device using libevdev-uinput and I’m having trouble understanding what governs the permissions that the device will be created with. Usually, I create the virtual device based on an existing device and it seemed that the virtual device would be assigned the same permissions as the original, but today I’m noticing that enabling certain events changes the permissions that the virtual device has. I suspect it has something to do with udev rules, but I really have no idea and it’s been kind of difficult to find detailed documentation about this. I’d like to know how I can control this behavior.
For example, the device is normally user-accessible, with these permissions:
crw-rw----+ 1 root input 13, 83 Nov 15 18:32 ./event19 # file: event19 # owner: root # group: input user::rw- user:me:rw- group::rw- mask::rw- other::---
Enabling a mouse button click causes the permissions to be root/input-group only:
libevdev_enable_event_code(dev, EV_KEY, BTN_LEFT, NULL); crw-rw---- 1 root input 13, 83 Nov 15 18:33 ./event19