Repository navigation
fix: apply a local -M to the receiver half only - #8365
Merged
Merged
Conversation
oferchen
force-pushed
the
fix/local-m-receiver-only
branch
4 times, most recently
from
November 11, 2026 10:31
99b3da4 to
2671d6a
Compare
execute() now translates the parse through translate(), which runs the process setup only on the process pass, and hands the result to run_translated(). Behaviour is unchanged; a later pass can translate a second option set without touching process globals, as 3.5.1 pipe.c local_child() re-parses -M for the receiver alone.
A local copy folded its -M values into the client argv, so one option set served both halves. 3.5.1 forks the receiver, which re-parses the -M values on top of the inherited options (pipe.c:109-148 local_child()); the sender keeps the client options. oc now keeps both sets: the client parse runs the process setup and is the sender set, the -M fold is translated without side effects as the receiver set, and the engine reads the sender set through sender_half() wherever the 3.5.1 sender does (walk, links, files-from, filter hiding, and source stat, ACL and xattr reads under --fake-super).
oferchen
force-pushed
the
fix/local-m-receiver-only
branch
from
November 11, 2026 10:49
2671d6a to
b2c814e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix: apply a local -M to the receiver half only
Fixes the required upstream-testsuite regression
fake-super-acl-xattrthat #8332 brought to master. Tasks 520, 540 and 641.Problem
On master, a local copy folds its
-Mvalues into the client argv, so both halves read one option set. Under-rA -M--fake-superthat makes the sender fake-super too. It then reads only the source's (empty)%aaclstash, and dst gets no%aacl/%dacl. The upstream test fails with "--fake-super -A should have stored user.rsync.%aacl on dst/f".3.5.1 forks the receiver, and only the receiver re-parses the
-Mvalues (pipe.c:143-148). The sender reads the real ACL (acls.c:609-631), and the receiver stashes it with set_xattr_acl (acls.c:933-971).#8332's 540 measurement still holds where both halves run fake-super:
-rA --fake-superwith no-M. 3.5.1 stores no%aacl/%daclthere, re-measured with a named-user ACL and a default dir ACL. That behaviour is unchanged.Commits
refactor: split the client run into a repeatable translation pass. Behaviour-neutral:execute()runstranslate()with aPass, and the process setup runs only on the process pass. The order of every early return and side effect is kept. A test checks that a--helpearly return reads no files and opens no log file.fix: apply a local -M to the receiver half only. Two option sets, described below.Mechanism
3.5.1 forks the receiver for a local copy. In
pipe.c:109-148local_child(), the child inherits the client's options and re-runsparse_arguments()over the-Mvalues on top of them. The parent sender keeps the client's own options. So every-Moption changes the receiver half only.oc used to fold
-Minto the client argv, which gave one option set for both halves. That set was wrong for the sender whenever-Mnamed something the sender reads. Now it keeps two option sets, as upstream does:parse_argskeeps the client's own parse asParsedArgs.local_sender, but only when a fold happened. The folded parse is the receiver's. Each set's filter order is built from the argv it was parsed from.execute()runs the real process setup on the client's own parse, as 3.5.1'smain()does, and that parse is also the sender's set. The-Mfold, the receiver's set, is translated on an inert pass (commit 1:translate()/Pass). The inert pass sets no globals, opens no log file and reads no password; pipe.c:131-141 clears the child's log file. It replays the--files-fromlist the process pass read rather than reading it again; pipe.c:133 sets the child'sfilesfrom_fd = -1. The run takes its output settings from the client parse and its config from the receiver set, with the sender's attached byClientConfig::with_local_sender().LocalCopyOptionsfrom it, with its own filter program, and attaches it withLocalCopyOptions::with_local_sender().LocalCopyOptions::sender_half()(CopyContext::sender_options()) returns the sender's set when there is one, andselfotherwise. Without-Mboth halves read one set, and behaviour is unchanged.Side table: which half reads what
-r/-d(walk,xfer_dirs)recursive_enabled/dirs_enabledfacades-L/-k/--copy-unsafe-linkscopy_*_enabledfacades,follow_source_symlinks--files-fromfiles_from_enabledis_excludedCopyContext.filter_program+dir_mergedelete_in_dir, :1750receiver_filter_program+delete_dir_mergersync_xal_setCopyContext::filter_program()(xattr sync)--fake-superx_stat/x_lstat; xattrs.c:1372ensure_fake_super_source_stat,fake_super_source_stat,store_effective_fake_super_if_requested, hard-link holder reorder--fake-superget_acl/get_xattr; acls.c:599-607source_attrs.rs, batch ACL read,FakeSuperSides.sender%stat/%aaclstoreset_stat_xattr; acls.c:933-971fake_super_enabled)-R(names)-R(dest parents)--no-implied-dirs-x(walk)-x(delete boundary)Cells (MEASURED, same commands against the 3.5.1 tarball build)
-d -M-rd/onlyd/only-r -M--no-r-r -M-Rtmp/...relative tree-r --delete -M--exclude=*.tmpx.tmpsent, desty.tmpkept,zdeletedx.tmphidden-r -M--fake-super, source 0644 with%stat 100600%stat 100644 0,0 0:0100600-rA -M--fake-super, named-user ACL%aaclstashedCells that stay identical, checked so the split cannot move them:
-M--chmod=o+r(the receiver applies it; 604 on both),-M-p,-M-x,-M--copy-dirlinks,-M--remove-source-files.Tests:
tests/local_remote_option_sides.rs: 5 oc-only cells that assert the measured 3.5.1 results, so they run in CI without the oracle.tests/local_copy_skip_and_fake_super_parity.rs:receiver_only_fake_super_ignores_the_source_stat_record: the %stat cell (task 641), oc-only.receiver_only_fake_super_stashes_the_real_source_acl: the ACL cell, oracle comparison.options/sides.rsunit tests.clihelp_returns_before_the_process_pass_reads_its_files: a help early return still reads no files and opens no log file.Not covered
-M-l(rc 22,recv_file_entryoverflow),-M--no-l(hang) and-M-c(rc 2, "File-list index ... not in"). These options change the flist shape, so the two halves stop agreeing on the wire format. There is nothing to mirror, so there are no cells.-rl -M--copy-links: 3.5.1 keeps the link. oc refuses the folded receiver argv with a clap conflict between-land-L, which 3.5.1 accepts. Filed as task 642 and not folded in, per review.-Mrule that adds a per-dir merge file loads on the receiver chain only. That is correct, but no cell covers it.-Moption that 3.5.1 applies per process but oc applies once per run takes the client's value in oc. Output levels are the main case. In 3.5.1,-M-vmakes the forked receiver printcreated directory t(main.c get_local_name), and-M-vvadds the generator'sdelta-transmission disabled for local transfer or --whole-file. The client's own output is unchanged. oc prints neither, because its verbosity, itemize, info/debug and out-format are process-global and come from the client parse. These are listed, not approximated.-M--log-file=F: pipe.c:136-140 clears the inherited log file in the receiver, and the-Mvalue parsed after it opens the receiver's own. oc opens F from the receiver set when the client parse names no log file. That keepsremote_option_applies_to_a_local_transfer. When both name a log file, oc writes only the client's, while 3.5.1 writes receiver lines to F as well.-M--copy-linksstays a symlink in 3.5.1. oc's receiver-side parse still refuses-ltogether with-L(task 642), so that cell waits for it.Upstream testsuite (fake-super-acl-xattr, host, 3.5.1 tarball suite)
PASS fake-super-acl-xattrPASS fake-super-acl-xattrThe three legs of fake-super-acl-xattr_test.py:89-111 were also replayed directly, against both 3.5.1 and oc. All three give identical results:
-rA -M--fake-super:%aaclon f,%daclon d.-rA --fake-super -M--fake-super: both kept.setfacl -k:%daclremoved.The other host-only failures in the same runs are not caused by this PR:
rrsync-userns-procfs: "cannot locate the rsync executable" for the debug binary path.operator-path-dir-daemon-leafandoperator-path-partial-dir-exclude-daemon: both compare against a host-only 3.2.7 oracle, and both are daemon--partial-dircells.