Skip to content

keventd: fix ENV{} match on unset properties - #513

Merged
troglobit merged 1 commit into
finit-project:masterfrom
vazub:keventd-input
Oct 24, 2026
Merged

troglobit merged 1 commit into
finit-project:masterfrom
vazub:keventd-input

Conversation

@vazub

@vazub vazub commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Problem: with --with-keventd and the curated rules, input devices end up in /run/udev/data/cN:M without ID_INPUT, so libinput finds no devices. As a result, anything relying on libinput (Wayland stack specifically) would either not start or otherwise error out. This issue got surfaced when using keventd together with apps linked against eudev's libudev (MangoWM in this case).

Cause: match_key() in keventd/rules.c returns (op == OP_MATCH_NE) when the subject is NULL, which is the case for an unset ENV{}. udev treats an unset property as the empty string. As a result, ENV{ID_INPUT}=="" and ENV{ID_BUS}=="" never match, so the input_id and usb_id builtins never run.

Fix: use "" as the subject when the property is unset (one line).

Behavior change: the != side changes too. ENV{x}!="" is now false for unset x, as in udev. In the shipped rules this affects:

50-udev-default.rules: ENV{MODALIAS}!="" guarding the hwdb import
70-joystick.rules and 70-touchpad.rules: ENV{ID_BUS}!=""
80-net-name-slot.rules: ENV{ID_NET_NAME_*}!="" guarding NAME=
50-udev-default.rules: ENV{REMOVE_CMD}!="" guarding RUN+=

All of these were previously true for unset properties and are now correctly false.


Tested the patch myself against 5.0-rc1, and verified successfully fixing the issue.

@troglobit troglobit left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, thanks!

@troglobit
troglobit merged commit 096e633 into finit-project:master Oct 24, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants