Skip to content

feat: gate --inplace --partial-dir rejection on CF_INPLACE_PARTIAL_DIR negotiation - #4064

Merged
oferchen merged 1 commit into
masterfrom
feat/inplace-partial-dir-cf-negotiation-2142
May 14, 2026
Merged

oferchen merged 1 commit into
masterfrom
feat/inplace-partial-dir-cf-negotiation-2142

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Add ClientConfigBuilder::validate_with_capabilities(caps) alongside the strict validate() default. When caps contains CompatibilityFlags::INPLACE_PARTIAL_DIR, --inplace/--append and --partial-dir are accepted; otherwise the upstream parse-time rejection at options.c:2406-2414 is preserved.
  • Pin the on-wire byte sequence for CF_INPLACE_PARTIAL_DIR (0x40) and the combined CF_INC_RECURSE | CF_INPLACE_PARTIAL_DIR (0x41) so the negotiation payload remains byte-identical to upstream's write_varint(f_out, compat_flags).
  • Mark G2 RESOLVED in docs/audits/compatibility-flags-mutual-exclusion-matrix.md and update the next-fix section accordingly.

Upstream reference: compat.c:117 defines CF_INPLACE_PARTIAL_DIR (1<<6); compat.c:777-778 enables inplace_partial = 1 when the bit is negotiated.

Refs #2142, #2143, #2144.

Test plan

  • cargo nextest run -p core --all-features -E 'test(validate_with_capabilities)'
  • cargo nextest run -p protocol --all-features -E 'test(inplace_partial_dir)'
  • Full CI: fmt+clippy, nextest stable, Windows, macOS, Linux musl

Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
@github-actions github-actions Bot added the enhancement New feature or request label May 14, 2026
@oferchen
oferchen merged commit d4248bc into master May 14, 2026
45 checks passed
oferchen added a commit that referenced this pull request May 16, 2026
Convert the compatibility-flags mutual-exclusion audit from a
current-state inventory into a historical record. Each gap row (G1-G4)
now cites the PR that landed the remediation:

- G1: --checksum-choice=none promotes whole_file=1 (PR #4066)
- G2: --inplace --partial-dir gated on CF_INPLACE_PARTIAL_DIR (PR #4064)
- G3: --append --whole-file rejected at config build time (PR #4049)
- G4: --delay-updates partial_dir promotion centralised (PR #4050)

Section 5 is replaced with a resolution-summary table. Footnotes [g]
and [j] are updated to describe the current behaviour and reference
the resolving PRs. The divergence descriptions are preserved so the
audit remains a record of the upstream-vs-oc-rsync conflict matrix
prior to remediation.

Refs: #2151, #2106
oferchen added a commit that referenced this pull request May 16, 2026
)

Convert the compatibility-flags mutual-exclusion audit from a
current-state inventory into a historical record. Each gap row (G1-G4)
now cites the PR that landed the remediation:

- G1: --checksum-choice=none promotes whole_file=1 (PR #4066)
- G2: --inplace --partial-dir gated on CF_INPLACE_PARTIAL_DIR (PR #4064)
- G3: --append --whole-file rejected at config build time (PR #4049)
- G4: --delay-updates partial_dir promotion centralised (PR #4050)

Section 5 is replaced with a resolution-summary table. Footnotes [g]
and [j] are updated to describe the current behaviour and reference
the resolving PRs. The divergence descriptions are preserved so the
audit remains a record of the upstream-vs-oc-rsync conflict matrix
prior to remediation.

Refs: #2151, #2106
@oferchen
oferchen deleted the feat/inplace-partial-dir-cf-negotiation-2142 branch May 16, 2026 19:50
oferchen added a commit that referenced this pull request May 18, 2026
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
oferchen added a commit that referenced this pull request May 18, 2026
)

Convert the compatibility-flags mutual-exclusion audit from a
current-state inventory into a historical record. Each gap row (G1-G4)
now cites the PR that landed the remediation:

- G1: --checksum-choice=none promotes whole_file=1 (PR #4066)
- G2: --inplace --partial-dir gated on CF_INPLACE_PARTIAL_DIR (PR #4064)
- G3: --append --whole-file rejected at config build time (PR #4049)
- G4: --delay-updates partial_dir promotion centralised (PR #4050)

Section 5 is replaced with a resolution-summary table. Footnotes [g]
and [j] are updated to describe the current behaviour and reference
the resolving PRs. The divergence descriptions are preserved so the
audit remains a record of the upstream-vs-oc-rsync conflict matrix
prior to remediation.

Refs: #2151, #2106
oferchen added a commit that referenced this pull request May 18, 2026
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
oferchen added a commit that referenced this pull request May 18, 2026
)

Convert the compatibility-flags mutual-exclusion audit from a
current-state inventory into a historical record. Each gap row (G1-G4)
now cites the PR that landed the remediation:

- G1: --checksum-choice=none promotes whole_file=1 (PR #4066)
- G2: --inplace --partial-dir gated on CF_INPLACE_PARTIAL_DIR (PR #4064)
- G3: --append --whole-file rejected at config build time (PR #4049)
- G4: --delay-updates partial_dir promotion centralised (PR #4050)

Section 5 is replaced with a resolution-summary table. Footnotes [g]
and [j] are updated to describe the current behaviour and reference
the resolving PRs. The divergence descriptions are preserved so the
audit remains a record of the upstream-vs-oc-rsync conflict matrix
prior to remediation.

Refs: #2151, #2106
oferchen added a commit that referenced this pull request Aug 24, 2026
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
oferchen added a commit that referenced this pull request Aug 24, 2026
)

Convert the compatibility-flags mutual-exclusion audit from a
current-state inventory into a historical record. Each gap row (G1-G4)
now cites the PR that landed the remediation:

- G1: --checksum-choice=none promotes whole_file=1 (PR #4066)
- G2: --inplace --partial-dir gated on CF_INPLACE_PARTIAL_DIR (PR #4064)
- G3: --append --whole-file rejected at config build time (PR #4049)
- G4: --delay-updates partial_dir promotion centralised (PR #4050)

Section 5 is replaced with a resolution-summary table. Footnotes [g]
and [j] are updated to describe the current behaviour and reference
the resolving PRs. The divergence descriptions are preserved so the
audit remains a record of the upstream-vs-oc-rsync conflict matrix
prior to remediation.

Refs: #2151, #2106
oferchen added a commit that referenced this pull request Aug 24, 2026
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability
bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at
compat.c:777-778 when both peers advertise the 'I' capability char).
With that bit set, the receiver enables per-file inplace for basis
files retrieved from the partial directory, so the otherwise
conflicting --inplace/--append plus --partial-dir combination runs
successfully.

Add ClientConfigBuilder::validate_with_capabilities alongside the
strict validate() default. The capability-aware variant accepts the
pair when the negotiated bitfield contains
CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the
upstream parse-time rejection (options.c:2406-2414) for callers that
have not yet seen the negotiated bits.

Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and
combined with CF_INC_RECURSE (0x41) so future varint refactors cannot
silently drift from upstream's write_varint payload.

Resolves G2 in
docs/audits/compatibility-flags-mutual-exclusion-matrix.md.
Refs #2142, #2143, #2144.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant