Skip to content

daemon: distinguish inetd from local stdin sockets - #1075

Open
steadytao wants to merge 6 commits into
RsyncProject:masterfrom
steadytao:fix/daemon-inetd-stdin
Open

daemon: distinguish inetd from local stdin sockets#1075
steadytao wants to merge 6 commits into
RsyncProject:masterfrom
steadytao:fix/daemon-inetd-stdin

Conversation

@steadytao

@steadytao steadytao commented Sep 2, 2026

Copy link
Copy Markdown
Member

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 and SO_KEEPALIVE on that socket before writing the rsync daemon greeting.

Local sockets are now treated as ordinary process I/O, allowing --daemon --no-detach to enter its normal listening loop. Genuine inetd connections remain detected through their connected IP stream and --no-detach retains its documented no-op behaviour in inetd mode.

@steadytao steadytao added the bug Something isn't working label Sep 2, 2026
@steadytao

Copy link
Copy Markdown
Member Author

@schuelermine not absolute but I do think this is likely the issue, could you test please?

@steadytao steadytao changed the title daemon: require IP stream for inetd mode daemon: distinguish inetd from local stdin sockets Sep 2, 2026
@schuelermine

Copy link
Copy Markdown

@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.
How can I make a distribution tarball from the repository?

@schuelermine

Copy link
Copy Markdown

(More specifically, it fails due to missing aclocal if I build from a tarball made from my own repository)

@steadytao

steadytao commented Sep 3, 2026

Copy link
Copy Markdown
Member Author

@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. How can I make a distribution tarball from the repository?

aclocal is provided by Automake. For a Nix environment, nix shell nixpkgs#autoconf nixpkgs#automake nixpkgs#gawk nixpkgs#gnumake -c ./prepare-source should generate the files required to build from the checkout. Please note to re-pull as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rsync daemon fails to start if PTY not allocated on Android

2 participants