Repository navigation
fix(daemon): unbackslash --groupmap=*:GID wildcard in non-protect_args path - #5752
Merged
Merged
Conversation
…s path Under secluded-args daemon push, the client's phase 1 wire was `--server [--sender] -s .` - both the trailing `.` and the bare `-s` diverge from upstream's `clientserver.c:395-402` wire layout. Upstream's phase 1 never contains a standalone `.` (that token only enters `sargs` in `do_cmd` at `clientserver.c:303` AFTER `server_options()` inserts the phase 1 / phase 2 split NULL at `options.c:2745`), and never contains a bare `-s` (the `s` for `--secluded-args` is embedded in the compact flag string `argstr` at `options.c:2622-2623`). The stray phase 1 `.` short-circuited the daemon's `apply_long_form_args` dot_position lookup (it picks the FIRST standalone `.` as the boundary between option region and positional file args). Every option after the phase 1 / phase 2 merge boundary - including `--groupmap=*:GID` - was silently dropped before reaching `GroupMapping::parse`, so the wildcard match rule was never installed on the receiver. Upstream regression #829 / `daemon-groupmap-wild` (`[secluded-args] groupmap upload failed (rc=12) + connection unexpectedly closed (23 bytes received) [sender]`). The bare `-s` also shadowed phase 2's real compact flag string in `build_server_config`'s first-short-form-arg picker, so compression / recursion / capability negotiation broke before the transfer started. Emit phase 1 as `--server [--sender] --secluded-args` instead. The long-form alias is in the daemon's `has_secluded_args_flag` detection set (`-s` | `--protect-args` | `--secluded-args`), so phase 2 reading still trips. Upstream daemons accept `--secluded-args` per `options.c:804` (`{"secluded-args", 's', POPT_ARG_VAL, ...}`), so this remains wire-compatible with upstream rsync. Adds character-level coverage on both ends of the wire: - `crates/core/.../orchestration/tests.rs` pins that `build_minimal_daemon_args` emits neither a standalone `.` nor a bare `-s` for both push and pull, and that phase 1 is exactly `[--server, [--sender], --secluded-args]`. - `crates/daemon/.../module_access/tests.rs` pins that the merged arg list from the new phase 1 + a representative phase 2 round-trips `--groupmap=*:4242` through `apply_long_form_args` to `GroupMapping::parse`, and that the real compact flag string (`-logDtprIze.LsfxCIvu`) is the first short-form arg in the merged list - locking against a future regression that would reintroduce the bare-`-s` shadow. upstream: clientserver.c:303 - `sargs[sargc++] = "."` after server_options() upstream: clientserver.c:395-402 - phase 1 wire writes args until !sargs[i] upstream: options.c:2622-2623 - `argstr[x++] = 's'` when `protect_args` upstream: options.c:2744-2745 - NULL marker between phase 1 / phase 2 args upstream: options.c:804 - `--secluded-args` long-form alias for `-s`
oferchen
force-pushed
the
fix/uts-8-reopen-groupmap-wild-backslash
branch
from
June 14, 2026 03:55
cb3c307 to
0bf2c51
Compare
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…s path (#5752) Under secluded-args daemon push, the client's phase 1 wire was `--server [--sender] -s .` - both the trailing `.` and the bare `-s` diverge from upstream's `clientserver.c:395-402` wire layout. Upstream's phase 1 never contains a standalone `.` (that token only enters `sargs` in `do_cmd` at `clientserver.c:303` AFTER `server_options()` inserts the phase 1 / phase 2 split NULL at `options.c:2745`), and never contains a bare `-s` (the `s` for `--secluded-args` is embedded in the compact flag string `argstr` at `options.c:2622-2623`). The stray phase 1 `.` short-circuited the daemon's `apply_long_form_args` dot_position lookup (it picks the FIRST standalone `.` as the boundary between option region and positional file args). Every option after the phase 1 / phase 2 merge boundary - including `--groupmap=*:GID` - was silently dropped before reaching `GroupMapping::parse`, so the wildcard match rule was never installed on the receiver. Upstream regression #829 / `daemon-groupmap-wild` (`[secluded-args] groupmap upload failed (rc=12) + connection unexpectedly closed (23 bytes received) [sender]`). The bare `-s` also shadowed phase 2's real compact flag string in `build_server_config`'s first-short-form-arg picker, so compression / recursion / capability negotiation broke before the transfer started. Emit phase 1 as `--server [--sender] --secluded-args` instead. The long-form alias is in the daemon's `has_secluded_args_flag` detection set (`-s` | `--protect-args` | `--secluded-args`), so phase 2 reading still trips. Upstream daemons accept `--secluded-args` per `options.c:804` (`{"secluded-args", 's', POPT_ARG_VAL, ...}`), so this remains wire-compatible with upstream rsync. Adds character-level coverage on both ends of the wire: - `crates/core/.../orchestration/tests.rs` pins that `build_minimal_daemon_args` emits neither a standalone `.` nor a bare `-s` for both push and pull, and that phase 1 is exactly `[--server, [--sender], --secluded-args]`. - `crates/daemon/.../module_access/tests.rs` pins that the merged arg list from the new phase 1 + a representative phase 2 round-trips `--groupmap=*:4242` through `apply_long_form_args` to `GroupMapping::parse`, and that the real compact flag string (`-logDtprIze.LsfxCIvu`) is the first short-form arg in the merged list - locking against a future regression that would reintroduce the bare-`-s` shadow. upstream: clientserver.c:303 - `sargs[sargc++] = "."` after server_options() upstream: clientserver.c:395-402 - phase 1 wire writes args until !sargs[i] upstream: options.c:2622-2623 - `argstr[x++] = 's'` when `protect_args` upstream: options.c:2744-2745 - NULL marker between phase 1 / phase 2 args upstream: options.c:804 - `--secluded-args` long-form alias for `-s`
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.
Summary
--server [--sender] -s ., which diverges from upstream'sclientserver.c:395-402wire layout. Upstream phase 1 never contains a standalone.(do_cmdonly appends.tosargsAFTERserver_options()returns past the NULL marker atoptions.c:2745) and never contains a bare-s(thesis embedded inside the compact flag stringargstrperoptions.c:2622-2623)..made the daemon'sapply_long_form_argsfirst-.dot_position lookup bound the option region BEFORE the merge boundary, so every long-form option emitted in phase 2 - including--groupmap=*:GID- was silently dropped before reachingGroupMapping::parse. The bare-salso shadowed phase 2's real compact flag string inbuild_server_config's first-short-form-arg picker, breaking compression/recursion negotiation. UTS-8.REOPEN / upstream issue Add daemon hosts allow/deny enforcement for module access #829 /daemon-groupmap-wild:[secluded-args] groupmap upload failed (rc=12) + connection unexpectedly closed (23 bytes received) [sender].--server [--sender] --secluded-args. The long-form alias is in the daemon'shas_secluded_args_flagdetection set, so phase 2 reading still trips, and upstream daemons accept the alias peroptions.c:804so this remains wire-compatible with upstream rsync.Test plan
build_minimal_daemon_argsemits neither a standalone.nor a bare-sfor push or pull, and is exactly[--server, [--sender], --secluded-args].--groupmap=*:4242),merge_secluded_args->apply_long_form_argsreachesGroupMapping::parsewith*:4242intact, and the real compact flag string (-logDtprIze.LsfxCIvu) is the first short-form arg in the merged list.cargo fmt --allclean before push (no formatting drift).daemon-groupmap-wild([secluded-args] groupmap upload) passes.upstream: clientserver.c:303 -
sargs[sargc++] = "."after server_options()upstream: clientserver.c:395-402 - phase 1 wire writes args until
!sargs[i]upstream: options.c:2622-2623 -
argstr[x++] = 's'whenprotect_argsupstream: options.c:2744-2745 - NULL marker between phase 1 / phase 2 args
upstream: options.c:804 -
--secluded-argslong-form alias for-s