Skip to content

feat: implement ACL wire format for upstream rsync 3.4.1 interop - #3092

Merged
oferchen merged 2 commits into
masterfrom
feat/acl-wire-format
Apr 4, 2026
Merged

oferchen merged 2 commits into
masterfrom
feat/acl-wire-format

Conversation

@oferchen

@oferchen oferchen commented Apr 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Implement full ACL wire protocol enabling --acls / -A interop with upstream rsync 3.4.1
  • Sender now reads real filesystem ACLs via exacl crate (get_rsync_acl) and strips base permission entries before sending, matching upstream rsync_acl_strip_perms() (acls.c:138-155)
  • Receiver reconstructs stripped base entries from file mode on apply, matching upstream change_sacl_perms() (acls.c:857-933)
  • Generator calls prepare_pending_acl() per file entry to read ACLs and pass them to the file list writer via set_pending_acl()
  • Platform stubs updated for iOS/tvOS/watchOS and no-op builds with new mode parameter

Test plan

  • CI: fmt+clippy passes (verified locally)
  • CI: nextest passes on all platforms (Linux, macOS, Windows, musl)
  • CI: interop oc:acls and up:acls tests pass against upstream rsync 3.4.1
  • Unit tests: 8 new tests for strip_perms_for_send covering mode variants, mask/group matching, wire roundtrip

Implement the full ACL wire protocol to enable --acls / -A interop with
upstream rsync. Three core capabilities were missing:

1. Sender reads real filesystem ACLs via exacl (get_rsync_acl) instead
   of faking from file mode bits alone.
2. Sender strips base permission entries before sending, matching
   upstream rsync_acl_strip_perms() in acls.c:138-155.
3. Receiver reconstructs stripped base entries from file mode, matching
   upstream change_sacl_perms() in acls.c:857-933.

The generator now calls prepare_pending_acl() for each file entry to
read ACLs from the filesystem and pass them to the file list writer
via set_pending_acl(). The writer strips and sends them on the wire.
On the receiver side, apply_acls_from_cache now accepts an optional
mode parameter for proper reconstruction of stripped entries.

Includes 8 unit tests for strip_perms_for_send covering basic files,
mode variants, mask/group matching, and wire roundtrip after stripping.
@github-actions github-actions Bot added the enhancement New feature or request label Apr 4, 2026
group_obj should only be stripped when it equals the group permission
bits from the file mode. When group_obj=3 and mode group bits=7, the
values differ so group_obj must be preserved on the wire.

upstream: acls.c:148 - group_obj == group_perms check
@oferchen
oferchen merged commit 167ca97 into master Apr 4, 2026
37 checks passed
@oferchen
oferchen deleted the feat/acl-wire-format branch April 4, 2026 10:08
oferchen added a commit that referenced this pull request May 1, 2026
* feat: implement ACL wire format for upstream rsync 3.4.1 interop

Implement the full ACL wire protocol to enable --acls / -A interop with
upstream rsync. Three core capabilities were missing:

1. Sender reads real filesystem ACLs via exacl (get_rsync_acl) instead
   of faking from file mode bits alone.
2. Sender strips base permission entries before sending, matching
   upstream rsync_acl_strip_perms() in acls.c:138-155.
3. Receiver reconstructs stripped base entries from file mode, matching
   upstream change_sacl_perms() in acls.c:857-933.

The generator now calls prepare_pending_acl() for each file entry to
read ACLs from the filesystem and pass them to the file list writer
via set_pending_acl(). The writer strips and sends them on the wire.
On the receiver side, apply_acls_from_cache now accepts an optional
mode parameter for proper reconstruction of stripped entries.

Includes 8 unit tests for strip_perms_for_send covering basic files,
mode variants, mask/group matching, and wire roundtrip after stripping.

* fix: correct ACL test expectation for group_obj when not matching mode

group_obj should only be stripped when it equals the group permission
bits from the file mode. When group_obj=3 and mode group bits=7, the
values differ so group_obj must be preserved on the wire.

upstream: acls.c:148 - group_obj == group_perms check
oferchen added a commit that referenced this pull request May 5, 2026
* feat: implement ACL wire format for upstream rsync 3.4.1 interop

Implement the full ACL wire protocol to enable --acls / -A interop with
upstream rsync. Three core capabilities were missing:

1. Sender reads real filesystem ACLs via exacl (get_rsync_acl) instead
   of faking from file mode bits alone.
2. Sender strips base permission entries before sending, matching
   upstream rsync_acl_strip_perms() in acls.c:138-155.
3. Receiver reconstructs stripped base entries from file mode, matching
   upstream change_sacl_perms() in acls.c:857-933.

The generator now calls prepare_pending_acl() for each file entry to
read ACLs from the filesystem and pass them to the file list writer
via set_pending_acl(). The writer strips and sends them on the wire.
On the receiver side, apply_acls_from_cache now accepts an optional
mode parameter for proper reconstruction of stripped entries.

Includes 8 unit tests for strip_perms_for_send covering basic files,
mode variants, mask/group matching, and wire roundtrip after stripping.

* fix: correct ACL test expectation for group_obj when not matching mode

group_obj should only be stripped when it equals the group permission
bits from the file mode. When group_obj=3 and mode group bits=7, the
values differ so group_obj must be preserved on the wire.

upstream: acls.c:148 - group_obj == group_perms check
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