Skip to content

fix: send a server receiver's --list-only listing to the pushing client - #8308

Merged
oferchen merged 3 commits into
masterfrom
fix/push-list-only
Nov 4, 2026
Merged

oferchen merged 3 commits into
masterfrom
fix/push-list-only

Conversation

@oferchen

@oferchen oferchen commented Nov 3, 2026

Copy link
Copy Markdown
Owner

Summary

oc-rsync --list-only src/ host:dst/ (a push) printed nothing when the far end was an oc server or oc daemon. rsync 3.5.1 prints the listing. An oc client pushing to a 3.5.1 server already worked: the defect was on the oc server receiver.

On a push the generator runs on the server, so upstream renders the listing there:

  • The client forwards --list-only when it was given explicitly (options.c:2923-2924) and moves no data.
  • recv_generator() hands each entry to list_file_entry() and returns (generator.c:1636-1643). The receiver never enters or writes the destination: get_local_name() returns NULL under list_only (main.c:725).
  • list_file_entry() formats "%s %*s %s%*s%*s %s%s%s\n" (generator.c:1318-1356). Its rprintf(FINFO, ...) reaches the client as MSG_INFO through rwrite() (log.c:355-366), and a daemon also logs it.

oc's server receiver collected the entries into its stats, which only a pulling client reads, and never sent them.

Fix

  • Send the listing. A server receiver now renders each entry and sends it as MSG_INFO, in the generator's walk order, through the same sink itemize lines use. A client receiver (a pull) still hands the entries back to the client to print, so the pull path is unchanged. The rendering is in transfer::receiver::list_line:
    • The size column is 14 wide with commas. server_options() never forwards -h/--no-h (options.c:2778-3190), so a server keeps human_readable = 1 (options.c:116, generator.c:1322).
    • Times come from the server's local zone, as upstream's timestring() (util1.c:1722-1739) does there.
    • -U and -N add the atime and crtime columns, and the atime column is blank for a directory. --delete-missing-args lists a missing operand as *missing (generator.c:1331-1338).
  • List the stored symlink target. The listing now shows F_SYMLINK, the target as recv_file_entry() stored it, munge prefix and sanitizing included (flist.c:1521-1524, :1553; generator.c:1345). The oracle found this one: a use chroot = no module munges symlinks by default, so 3.5.1 lists link -> /rsyncd-munged/a.txt. The listing previously showed the raw target.
  • One copy of upstream's text renderers. permstring() (lib/permstring.c), the comma grouping of do_big_num() (lib/compat.c) and timestring() move into logging::upstream_text. The daemon %B field, the log-file timestamp and the cli size column now call them, and their own copies are removed. transfer gains platform as a normal dependency for the local zone offset.

Oracle

crates/transfer/tests/push_list_only_reaches_client.rs. Every expected listing is the verbatim stdout of the rsync 3.5.1 tarball build on the same fixture, with TZ=UTC on both ends; only directory sizes are blanked. When 3.5.1 is installed, each cell also runs the other client/server pairings and requires byte-identical output.

Cell oc client to oc server 3.5.1 client to oc server 3.5.1 to 3.5.1 Before the fix
rsh push, -rl and -r identical identical reference oc server printed nothing
daemon push, -rl (use chroot = no) identical identical reference oc daemon printed nothing
rsh pull, -rl (control) identical n/a reference already passed

Mutations

Each mutation was applied to the committed fix and the named tests were run.

Mutation Killed by
server does not send the rendered lines rsh push and daemon push cells
listing uses the raw wire target instead of the stored one daemon push cell
comma grouping every 4 digits list_line and comma_num unit tests
permstring gives a symlink type - permstring_matches_upstream
timestring year off by one the timestring unit tests

A sixth mutation forced the -l arrow on. It survived, because without -l the sender sends no target, so that check could never change the output. The check was removed rather than kept as dead code.

Gates

fmt, check_rustfmt_all.py, workspace clippy with -D warnings, the windows-gnu workspace check, and the oracle above, run against the 3.5.1 tarball build.

@oferchen
oferchen merged commit 3b3d16c into master Nov 4, 2026
86 of 90 checks passed
@oferchen
oferchen deleted the fix/push-list-only branch November 4, 2026 14:43
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