fix: skip empty SCM_RIGHTS when no fds to send#18
fix: skip empty SCM_RIGHTS when no fds to send#18markc wants to merge 1 commit intoids1024:masterfrom
Conversation
When `fds` is empty, `send_with_fds` was still attaching an empty SCM_RIGHTS ancillary message. This confuses some EIS servers (notably KWin) which interpret an empty SCM_RIGHTS as malformed and silently stop processing the connection. Skip ancillary data entirely when there are no fds to send. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Huh, is it not just using libeis, in which case I wouldn't expect KDE to be interacting with this at the socket level in a way that could affect this? Though it's reasonable enough to do this, particularly since it presumably matches libei. |
|
Sorry, I can't remember the exact situation that lead to this PR but the binary I was building would simply not work until this fix was applied. |
|
Testing in my Kubuntu 25.10 VM, the Maybe a difference based on the version of libeis that's installed? (Or the version of KDE). |
Summary
send_with_fdswhen thefdsslice is emptysendmsgwithout ancillary data instead of sending an empty SCM_RIGHTS messageProblem
When
fdsis empty,send_with_fdsconstructs anScmRights(&[])ancillary message with zero fds. Some EIS servers — notably KWin'sorg.kde.KWin.EIS.RemoteDesktop— interpret this empty SCM_RIGHTS as malformed and silently stop processing the connection. This causes the client to never receive seat/device events after the handshake completes.Fix
Check
fds.is_empty()before constructing the ancillary buffer. When empty, callsendmsgwith an emptySendAncillaryBuffer(no ancillary data at all). When fds are present, behavior is unchanged.Found while porting ei-type (a keyboard injector for KDE Plasma 6 Wayland) from C/libei to Rust/reis.