Repository navigation
Conversation
Adds `dacl_to_posix_mode(sddl)` and `posix_mode_to_dacl(mode, owner_sid, group_sid)` to `crates/metadata/src/acl_windows.rs`, implementing the cross-platform translation matrix described in section 5 of `docs/design/windows-ntfs-acl-support.md`. - `dacl_to_posix_mode` parses an SDDL security descriptor string, locates the first allow ACE matching the owner SID, group SID, and Everyone (`WD`) trustee respectively, and folds their rights into a standard rwxrwxrwx mode triplet. Falls back to `AU` (Authenticated Users) for the other triplet when no explicit Everyone ACE is present. - `posix_mode_to_dacl` emits the canonical three-ACE form with the `P` (protected) DACL flag so parent inheritance cannot silently inject ACEs not present on the source. - Lossy cases (documented in section 5.3 of the design doc) are preserved as warnings via the existing `warn_partial_apply` channel: deny ACEs dropped, inherited (`ID`) ACEs dropped, non-rwx access bits collapsed. Unit tests cover the canonical round trip across the full 0o000-0o777 mode matrix plus targeted assertions for deny ACE drop, inherited ACE drop, Everyone vs Authenticated Users fallback, and the `PROTECTED_DACL_SECURITY_INFORMATION` flag.
10 tasks
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Routes the `--acls` apply path through `acl_windows::read_dacl_sddl` / `write_dacl_sddl` on Windows so DACL preservation rides the SDDL fidelity payload from WAS-2/3 (#4354) instead of re-encoding only the named ACEs. Cross-platform interop keeps the WAS-4 (#4361) `dacl_to_posix_mode` and `posix_mode_to_dacl` helpers as the lossy fall-back when one peer is POSIX. Wire format reserves `user.win32.security_descriptor` (matches Samba's NT-ACL slot on Linux backends) inside the existing xattr stream. The sender appends an `XattrEntry` with the source's SDDL via `metadata::sddl_xattr_entry`; the receiver consumes it in `apply_xattrs_from_list`, dispatching to `write_dacl_sddl` on Windows and silently dropping the slot on POSIX so the cross-platform rsync ACL payload from `crates/protocol/src/acl/wire` still drives the lowered POSIX bits. Local Windows-to-Windows `sync_acls` likewise prefers the SDDL round-trip and falls back to the named-ACE encoder only on volumes that refuse to serve a descriptor (FAT32, network mounts). Tests cover the new helpers on every platform and round-trip a custom DACL through a Windows tempdir under `#[cfg(windows)]` so the new dispatch shape is exercised end-to-end on `windows-latest` nextest.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Routes the `--acls` apply path through `acl_windows::read_dacl_sddl` / `write_dacl_sddl` on Windows so DACL preservation rides the SDDL fidelity payload from WAS-2/3 (#4354) instead of re-encoding only the named ACEs. Cross-platform interop keeps the WAS-4 (#4361) `dacl_to_posix_mode` and `posix_mode_to_dacl` helpers as the lossy fall-back when one peer is POSIX. Wire format reserves `user.win32.security_descriptor` (matches Samba's NT-ACL slot on Linux backends) inside the existing xattr stream. The sender appends an `XattrEntry` with the source's SDDL via `metadata::sddl_xattr_entry`; the receiver consumes it in `apply_xattrs_from_list`, dispatching to `write_dacl_sddl` on Windows and silently dropping the slot on POSIX so the cross-platform rsync ACL payload from `crates/protocol/src/acl/wire` still drives the lowered POSIX bits. Local Windows-to-Windows `sync_acls` likewise prefers the SDDL round-trip and falls back to the named-ACE encoder only on volumes that refuse to serve a descriptor (FAT32, network mounts). Tests cover the new helpers on every platform and round-trip a custom DACL through a Windows tempdir under `#[cfg(windows)]` so the new dispatch shape is exercised end-to-end on `windows-latest` nextest.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Routes the `--acls` apply path through `acl_windows::read_dacl_sddl` / `write_dacl_sddl` on Windows so DACL preservation rides the SDDL fidelity payload from WAS-2/3 (#4354) instead of re-encoding only the named ACEs. Cross-platform interop keeps the WAS-4 (#4361) `dacl_to_posix_mode` and `posix_mode_to_dacl` helpers as the lossy fall-back when one peer is POSIX. Wire format reserves `user.win32.security_descriptor` (matches Samba's NT-ACL slot on Linux backends) inside the existing xattr stream. The sender appends an `XattrEntry` with the source's SDDL via `metadata::sddl_xattr_entry`; the receiver consumes it in `apply_xattrs_from_list`, dispatching to `write_dacl_sddl` on Windows and silently dropping the slot on POSIX so the cross-platform rsync ACL payload from `crates/protocol/src/acl/wire` still drives the lowered POSIX bits. Local Windows-to-Windows `sync_acls` likewise prefers the SDDL round-trip and falls back to the named-ACE encoder only on volumes that refuse to serve a descriptor (FAT32, network mounts). Tests cover the new helpers on every platform and round-trip a custom DACL through a Windows tempdir under `#[cfg(windows)]` so the new dispatch shape is exercised end-to-end on `windows-latest` nextest.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Routes the `--acls` apply path through `acl_windows::read_dacl_sddl` / `write_dacl_sddl` on Windows so DACL preservation rides the SDDL fidelity payload from WAS-2/3 (#4354) instead of re-encoding only the named ACEs. Cross-platform interop keeps the WAS-4 (#4361) `dacl_to_posix_mode` and `posix_mode_to_dacl` helpers as the lossy fall-back when one peer is POSIX. Wire format reserves `user.win32.security_descriptor` (matches Samba's NT-ACL slot on Linux backends) inside the existing xattr stream. The sender appends an `XattrEntry` with the source's SDDL via `metadata::sddl_xattr_entry`; the receiver consumes it in `apply_xattrs_from_list`, dispatching to `write_dacl_sddl` on Windows and silently dropping the slot on POSIX so the cross-platform rsync ACL payload from `crates/protocol/src/acl/wire` still drives the lowered POSIX bits. Local Windows-to-Windows `sync_acls` likewise prefers the SDDL round-trip and falls back to the named-ACE encoder only on volumes that refuse to serve a descriptor (FAT32, network mounts). Tests cover the new helpers on every platform and round-trip a custom DACL through a Windows tempdir under `#[cfg(windows)]` so the new dispatch shape is exercised end-to-end on `windows-latest` nextest.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Routes the `--acls` apply path through `acl_windows::read_dacl_sddl` / `write_dacl_sddl` on Windows so DACL preservation rides the SDDL fidelity payload from WAS-2/3 (#4354) instead of re-encoding only the named ACEs. Cross-platform interop keeps the WAS-4 (#4361) `dacl_to_posix_mode` and `posix_mode_to_dacl` helpers as the lossy fall-back when one peer is POSIX. Wire format reserves `user.win32.security_descriptor` (matches Samba's NT-ACL slot on Linux backends) inside the existing xattr stream. The sender appends an `XattrEntry` with the source's SDDL via `metadata::sddl_xattr_entry`; the receiver consumes it in `apply_xattrs_from_list`, dispatching to `write_dacl_sddl` on Windows and silently dropping the slot on POSIX so the cross-platform rsync ACL payload from `crates/protocol/src/acl/wire` still drives the lowered POSIX bits. Local Windows-to-Windows `sync_acls` likewise prefers the SDDL round-trip and falls back to the named-ACE encoder only on volumes that refuse to serve a descriptor (FAT32, network mounts). Tests cover the new helpers on every platform and round-trip a custom DACL through a Windows tempdir under `#[cfg(windows)]` so the new dispatch shape is exercised end-to-end on `windows-latest` nextest.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Routes the `--acls` apply path through `acl_windows::read_dacl_sddl` / `write_dacl_sddl` on Windows so DACL preservation rides the SDDL fidelity payload from WAS-2/3 (#4354) instead of re-encoding only the named ACEs. Cross-platform interop keeps the WAS-4 (#4361) `dacl_to_posix_mode` and `posix_mode_to_dacl` helpers as the lossy fall-back when one peer is POSIX. Wire format reserves `user.win32.security_descriptor` (matches Samba's NT-ACL slot on Linux backends) inside the existing xattr stream. The sender appends an `XattrEntry` with the source's SDDL via `metadata::sddl_xattr_entry`; the receiver consumes it in `apply_xattrs_from_list`, dispatching to `write_dacl_sddl` on Windows and silently dropping the slot on POSIX so the cross-platform rsync ACL payload from `crates/protocol/src/acl/wire` still drives the lowered POSIX bits. Local Windows-to-Windows `sync_acls` likewise prefers the SDDL round-trip and falls back to the named-ACE encoder only on volumes that refuse to serve a descriptor (FAT32, network mounts). Tests cover the new helpers on every platform and round-trip a custom DACL through a Windows tempdir under `#[cfg(windows)]` so the new dispatch shape is exercised end-to-end on `windows-latest` nextest.
Owner
Author
|
Superseded by master's WAS-5 (#4388). Per PRC-3a audit (PR #4453), all 11 hunks are either already in master (7/11) or purely cosmetic comment additions (4/11). Master already ships dacl_to_posix_mode/posix_mode_to_dacl with full SDDL grammar, lib.rs re-exports, and identical test coverage including the 0o000..=0o777 round-trip matrix. |
oferchen
added a commit
that referenced
this pull request
May 18, 2026
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Routes the `--acls` apply path through `acl_windows::read_dacl_sddl` / `write_dacl_sddl` on Windows so DACL preservation rides the SDDL fidelity payload from WAS-2/3 (#4354) instead of re-encoding only the named ACEs. Cross-platform interop keeps the WAS-4 (#4361) `dacl_to_posix_mode` and `posix_mode_to_dacl` helpers as the lossy fall-back when one peer is POSIX. Wire format reserves `user.win32.security_descriptor` (matches Samba's NT-ACL slot on Linux backends) inside the existing xattr stream. The sender appends an `XattrEntry` with the source's SDDL via `metadata::sddl_xattr_entry`; the receiver consumes it in `apply_xattrs_from_list`, dispatching to `write_dacl_sddl` on Windows and silently dropping the slot on POSIX so the cross-platform rsync ACL payload from `crates/protocol/src/acl/wire` still drives the lowered POSIX bits. Local Windows-to-Windows `sync_acls` likewise prefers the SDDL round-trip and falls back to the named-ACE encoder only on volumes that refuse to serve a descriptor (FAT32, network mounts). Tests cover the new helpers on every platform and round-trip a custom DACL through a Windows tempdir under `#[cfg(windows)]` so the new dispatch shape is exercised end-to-end on `windows-latest` nextest.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
oferchen
added a commit
that referenced
this pull request
May 18, 2026
Routes the `--acls` apply path through `acl_windows::read_dacl_sddl` / `write_dacl_sddl` on Windows so DACL preservation rides the SDDL fidelity payload from WAS-2/3 (#4354) instead of re-encoding only the named ACEs. Cross-platform interop keeps the WAS-4 (#4361) `dacl_to_posix_mode` and `posix_mode_to_dacl` helpers as the lossy fall-back when one peer is POSIX. Wire format reserves `user.win32.security_descriptor` (matches Samba's NT-ACL slot on Linux backends) inside the existing xattr stream. The sender appends an `XattrEntry` with the source's SDDL via `metadata::sddl_xattr_entry`; the receiver consumes it in `apply_xattrs_from_list`, dispatching to `write_dacl_sddl` on Windows and silently dropping the slot on POSIX so the cross-platform rsync ACL payload from `crates/protocol/src/acl/wire` still drives the lowered POSIX bits. Local Windows-to-Windows `sync_acls` likewise prefers the SDDL round-trip and falls back to the named-ACE encoder only on volumes that refuse to serve a descriptor (FAT32, network mounts). Tests cover the new helpers on every platform and round-trip a custom DACL through a Windows tempdir under `#[cfg(windows)]` so the new dispatch shape is exercised end-to-end on `windows-latest` nextest.
oferchen
added a commit
that referenced
this pull request
May 18, 2026
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
Routes the `--acls` apply path through `acl_windows::read_dacl_sddl` / `write_dacl_sddl` on Windows so DACL preservation rides the SDDL fidelity payload from WAS-2/3 (#4354) instead of re-encoding only the named ACEs. Cross-platform interop keeps the WAS-4 (#4361) `dacl_to_posix_mode` and `posix_mode_to_dacl` helpers as the lossy fall-back when one peer is POSIX. Wire format reserves `user.win32.security_descriptor` (matches Samba's NT-ACL slot on Linux backends) inside the existing xattr stream. The sender appends an `XattrEntry` with the source's SDDL via `metadata::sddl_xattr_entry`; the receiver consumes it in `apply_xattrs_from_list`, dispatching to `write_dacl_sddl` on Windows and silently dropping the slot on POSIX so the cross-platform rsync ACL payload from `crates/protocol/src/acl/wire` still drives the lowered POSIX bits. Local Windows-to-Windows `sync_acls` likewise prefers the SDDL round-trip and falls back to the named-ACE encoder only on volumes that refuse to serve a descriptor (FAT32, network mounts). Tests cover the new helpers on every platform and round-trip a custom DACL through a Windows tempdir under `#[cfg(windows)]` so the new dispatch shape is exercised end-to-end on `windows-latest` nextest.
oferchen
added a commit
that referenced
this pull request
Aug 24, 2026
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
dacl_to_posix_mode(sddl)andposix_mode_to_dacl(mode, owner_sid, group_sid)tocrates/metadata/src/acl_windows.rs, implementing the cross-platform translation matrix fromdocs/design/windows-ntfs-acl-support.mdsection 5 (WAS-4 / chore: update Homebrew formula for v0.5.3 #2309).dacl_to_posix_modeparses the SDDL security descriptor, splits off theO:/G:/D:/S:sections, walks the DACL ACE list, and folds the first matching allow ACEs into a 9-bit rwxrwxrwx triplet. Owner SID -> owner bits, group SID -> group bits,WD(Everyone) -> other bits, withAU(Authenticated Users) as a documented fallback when no Everyone ACE is present.posix_mode_to_daclemits the canonical three-ACE form (owner, group, Everyone) with thePflag on the DACL header so parent inheritance cannot silently inject ACEs that were never on the source.warn_partial_applyonce-only diagnostic, matching section 5.3 of the design doc: deny ACEs dropped, inherited (ID) ACEs dropped, non-rwx access bits collapsed, inheritance flags not transmitted.lib.rsre-exports both new functions behind the existing#[cfg(all(feature = \"acl\", windows))]gate socrates/metadataconsumers can use them without reaching into the private module.Test plan
windows-latest:round_trip_mode_755_preserves_rwx_tripletround_trip_full_mode_matrix_preserves_rwx(0o000..=0o777 round-trip)posix_mode_to_dacl_uses_three_allow_aces_with_protected_flagdacl_to_posix_mode_handles_everyone_as_otherdacl_to_posix_mode_falls_back_to_authenticated_usersdacl_to_posix_mode_drops_deny_acesdacl_to_posix_mode_drops_inherited_acesdacl_to_posix_mode_collapses_non_rwx_bitssddl_rights_decode_two_letter_tokens/sddl_rights_decode_hex_maskcfg(all(feature = \"acl\", windows)))