Repository navigation
fix: implement upstream 3.4.4 unbackslash_arg on non-protect_args daemon path (URV-2.a) - #5544
Merged
Merged
Conversation
Mirrors upstream rsync 3.4.4's io.c:1295-1306 unbackslash_arg() and the new `unescape` parameter that clientserver.c:1073 passes to the first read_args() call. Under non-protect_args daemon mode the client backslash-escapes shell and wildcard metacharacters via options.c:safe_arg(); without a matching unescape on the receiving side the daemon parses the literal `\*` token and loses the wildcard. The protect_args path remains unaffected because the secluded-args stream is not shell-evaluated. - Daemon: add unbackslash_arg() and apply it to phase-1 option args (those preceding the `.` CWD marker) so a non-secluded client's escapes are reversed before option parsing, matching upstream io.c:1336-1359. - Client: route every phase-1 daemon arg through safe_arg_for_daemon(), splitting `--key=value` at the first `=` so option values get the WILD_CHARS+SHELL_CHARS escape and bare filename / module-path args get the SHELL_CHARS escape (mirroring options.c:safe_arg() exactly). - Tests cover the round-trip on both sides plus the audit-cited regression `--groupmap=*:1234;dangerous` and upstream's `\<wildcard>` preserve-as-is exception for filename args.
2 tasks
oferchen
added a commit
that referenced
this pull request
Jun 10, 2026
Group PRs #5510, #5516, #5519, #5520, #5523, #5525-#5544 by shared root cause rather than by Stream bucket. Seven clusters surface; the parser- stores-string and field-vs-method shadowing clusters cover the largest share of the series, and the receiver-driver wiring-parity gap explains the NDX_DEL_STATS goodbye misses in both #5536 and #5542. Includes a defense-in-depth audit mapping each cluster onto the rust-landlock ruleset wired at crates/fast_io/src/landlock.rs. Doc-only; no code paths touched.
oferchen
added a commit
that referenced
this pull request
Jun 10, 2026
Group PRs #5510, #5516, #5519, #5520, #5523, #5525-#5544 by shared root cause rather than by Stream bucket. Seven clusters surface; the parser- stores-string and field-vs-method shadowing clusters cover the largest share of the series, and the receiver-driver wiring-parity gap explains the NDX_DEL_STATS goodbye misses in both #5536 and #5542. Includes a defense-in-depth audit mapping each cluster onto the rust-landlock ruleset wired at crates/fast_io/src/landlock.rs. Doc-only; no code paths touched.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Group PRs #5510, #5516, #5519, #5520, #5523, #5525-#5544 by shared root cause rather than by Stream bucket. Seven clusters surface; the parser- stores-string and field-vs-method shadowing clusters cover the largest share of the series, and the receiver-driver wiring-parity gap explains the NDX_DEL_STATS goodbye misses in both #5536 and #5542. Includes a defense-in-depth audit mapping each cluster onto the rust-landlock ruleset wired at crates/fast_io/src/landlock.rs. Doc-only; no code paths touched.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
…mon path (URV-2.a) (#5544) * fix: implement upstream 3.4.4 unbackslash_arg on non-protect daemon path Mirrors upstream rsync 3.4.4's io.c:1295-1306 unbackslash_arg() and the new `unescape` parameter that clientserver.c:1073 passes to the first read_args() call. Under non-protect_args daemon mode the client backslash-escapes shell and wildcard metacharacters via options.c:safe_arg(); without a matching unescape on the receiving side the daemon parses the literal `\*` token and loses the wildcard. The protect_args path remains unaffected because the secluded-args stream is not shell-evaluated. - Daemon: add unbackslash_arg() and apply it to phase-1 option args (those preceding the `.` CWD marker) so a non-secluded client's escapes are reversed before option parsing, matching upstream io.c:1336-1359. - Client: route every phase-1 daemon arg through safe_arg_for_daemon(), splitting `--key=value` at the first `=` so option values get the WILD_CHARS+SHELL_CHARS escape and bare filename / module-path args get the SHELL_CHARS escape (mirroring options.c:safe_arg() exactly). - Tests cover the round-trip on both sides plus the audit-cited regression `--groupmap=*:1234;dangerous` and upstream's `\<wildcard>` preserve-as-is exception for filename args. * style: apply rustfmt to daemon transfer arguments
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
io.c:1295-1306unbackslash_arg()and the newunescapeparameterclientserver.c:1073passes to the firstread_args()call. Under non-protect daemon mode the client backslash-escapes shell and wildcard metacharacters viaoptions.c:safe_arg(); without a matching unescape on the receiving side the daemon parses the literal\*token and loses the wildcard.unbackslash_arg()and apply it to phase-1 option args (those preceding the.CWD marker) so a non-secluded client's escapes are reversed before option parsing, matching upstreamio.c:1336-1359.safe_arg_for_daemon(), splitting--key=valueat the first=so option values get theWILD_CHARS+SHELL_CHARSescape and bare filename / module-path args get theSHELL_CHARSescape (mirroringoptions.c:safe_arg()exactly). The protect_args path is unchanged.Test plan
unbackslash_arg_collapses_backslash_escapes,unescape_phase1_option_args_stops_at_dot_marker,unescape_phase1_option_args_no_dot_marker_unescapes_allincrates/daemon/src/daemon/sections/module_access/tests.rs.option_arg_round_trips_shell_meta_value(audit-cited--groupmap=*:1234;dangerouscase),filename_arg_preserves_escaped_wildcard,option_arg_doubles_pre_escaped_wildcard, and the SHELL_CHARS / WILD_CHARS coverage tests incrates/core/src/client/remote/daemon_transfer/orchestration/arguments.rs.