Skip to content

Fix/repo audit corrections#4

Merged
NicolasPogorzelski merged 7 commits into
mainfrom
fix/repo-audit-corrections
Jul 9, 2026
Merged

Fix/repo audit corrections#4
NicolasPogorzelski merged 7 commits into
mainfrom
fix/repo-audit-corrections

Conversation

@NicolasPogorzelski

Copy link
Copy Markdown
Owner

Summary

  • Fixes across gate matching, manager fd-handling, install robustness, and CI runtime deps
  • Docs corrected to match actual code behavior (Steam controller-support setting, timing values, stale v1 references)

Details

  • gate: literal HID_UNIQ match, reject dot markers
  • manager: release remapper fds on error paths, atomic config write
  • install: trigger udev for hidraw, resilient service-state reporting
  • ci: install runtime deps so unit tests actually run
  • docs: correct Steam PlayStation-support setting, player-LED re-assert timing (8s→6s), stale v1 refs

grep -Fqx so a MAC/serial containing '.' cannot match a different device's HID_UNIQ line as a regex wildcard. Reject '.'/'..' uniqs that pass the charset but name the marker dir itself / its parent. Also correct the stale 71- rule name in the header comment (the installed rule is 72-).
Remapper.run() opened the self-pipe (and src/uinput) but the three early error returns (source open, uinput create, grab fail) returned before the finally that closes them — leaking 2-3 fds per failed attempt. Under a pad whose grab keeps racing, the 2 s reconcile retries and exhausts the fd budget in minutes. Wrap the body in one try/finally that frees every resource on all paths.

save_config now writes a temp file, fsyncs and os.replace()s it, so a crash mid-write can no longer truncate controller-modes.json (which load_config would swallow, silently dropping all modes + player numbers). Both config helpers use with-managed handles.
…ently

udevadm trigger --subsystem-match=hidraw after the reload so the new rule applies to already-connected pads now, not at the next reconnect. Report the service state via is-active --quiet in an if, so a non-active service prints a journalctl hint and exits 1 instead of aborting silently under set -e before the message.
The tests import evdev/dbus/gi; without them they raise ModuleNotFoundError and sys.exit(0) — CI was green because the suite skipped, not passed. Install python3-evdev/-dbus/-gi via apt (system python, which validate-repo.sh uses) instead of setup-python+pip (which compiles C extensions). Also shellcheck controller-led.
The 2026-07-06 pivot requires PlayStation controller support = 'Enabled in Games w/o Support' (plus Xbox support off); README and the install runbook told users to DISABLE it, which is the one broken middle ground (Steam still opens the pad to identify it and latches the lightbar). Fix both, and reframe the overview/troubleshooting text that implied disabling prevents the latch — the daemon rearms via driver rebind once the last holder exits.

Also in these files: clarify that a native hidraw node shows a seat ACL (not a fixed 666), and add the missing update/multi-controller runbook and player-leds decision links in the README.
SECURITY.md now lists both root helpers and the full privileged surface (chmod + marker files + driver rebind), not just chmod. per-device-identity.md updated from v1 to v2: identity chain (uniq->phys->vid:pid), player-number tray label, identity-keyed gate. ROADMAP records the liveness item as resolved and adds the deferred main-loop-blocking limitation. runbooks index and CONTRIBUTING gain the multi-controller runbook link.
The runbook claimed ~8s; _arm_player_reassert() schedules the one-shot
repaint at a fixed 6.0s, matching every other timing claim already
verified elsewhere in the docs.
@NicolasPogorzelski NicolasPogorzelski merged commit b4e5280 into main Jul 9, 2026
2 checks passed
@NicolasPogorzelski NicolasPogorzelski deleted the fix/repo-audit-corrections branch July 9, 2026 08:00
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.

1 participant