Skip to content

docs(audits): compatibility-flags matrix audit (#2106) - #3996

Merged
oferchen merged 1 commit into
masterfrom
docs/compat-flags-full-audit-2106
May 13, 2026
Merged

oferchen merged 1 commit into
masterfrom
docs/compat-flags-full-audit-2106

Conversation

@oferchen

Copy link
Copy Markdown
Owner

Summary

  • Full audit of all 9 CF_* compatibility flags from upstream rsync 3.4.1 compat.c against oc-rsync implementation
  • Covers flag inventory, build_our_flags() correctness, consumer-side honour logic, option interaction matrix (18 options), protocol version gating, and risk assessment
  • Identified a MEDIUM-risk semantic inversion bug in want_xattr_optim (CF_AVOID_XATTR_OPTIM handling) in receiver/transfer/pipeline.rs - the polarity is inverted relative to upstream, and the protocol >= 31 gate is missing. This can cause wire desync when --xattrs and --hard-links are both active

Key findings

  • 8 of 9 flags: fully correct implementation (LOW risk)
  • 1 flag (CF_AVOID_XATTR_OPTIM): semantic inversion in consumer logic (MEDIUM risk) - oc-rsync sets want_xattr_optim = true when the AVOID bit IS set, but upstream sets it to true when the bit is NOT set. Fix is straightforward (negate the contains check + add proto >= 31 gate)
  • All flag definitions, bit values, capability characters, and wire encoding match upstream exactly
  • All protocol version restrictions match upstream

Test plan

  • Review audit findings against upstream compat.c:746 for want_xattr_optim inversion
  • Verify P1 fix for want_xattr_optim polarity is tracked as a follow-up issue
  • Confirm wire encoding golden tests cover all 9 flags

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 13, 2026
@oferchen
oferchen merged commit 8921917 into master May 13, 2026
8 checks passed
@oferchen
oferchen deleted the docs/compat-flags-full-audit-2106 branch May 14, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant