daemon: distinguish inetd from local stdin sockets - #1075
Conversation
|
@schuelermine not absolute but I do think this is likely the issue, could you test please? |
|
@steadytao I’ve been trying to test this. Unfortunately, I don’t have a non-Nix cross compilation environment set up, and the Nixpkgs code refuses to work with the bare repository instead of the distribution tarballs. |
|
(More specifically, it fails due to missing aclocal if I build from a tarball made from my own repository) |
aclocal is provided by Automake. For a Nix environment, |
Signed-off-by: Zen Dodd <mail@steadytao.com>
May fix #1068
Summary
Require stdin to be a connected IPv4 or IPv6 stream socket before selecting inetd mode.
ADB shell without a PTY presents stdin as a local socket. The existing
is_a_socket(STDIN_FILENO)check therefore mistakes the ADB process channel for an accepted rsync connection. Rsync then attempts client-address lookup andSO_KEEPALIVEon that socket before writing the rsync daemon greeting.Local sockets are now treated as ordinary process I/O, allowing
--daemon --no-detachto enter its normal listening loop. Genuine inetd connections remain detected through their connected IP stream and--no-detachretains its documented no-op behaviour in inetd mode.