Skip to content

feat(metadata): complete Windows ACL read/write via windows-rs (#1866)#3558

Merged
oferchen merged 4 commits into
masterfrom
feat/windows-acl-engine-wiring
May 2, 2026
Merged

feat(metadata): complete Windows ACL read/write via windows-rs (#1866)#3558
oferchen merged 4 commits into
masterfrom
feat/windows-acl-engine-wiring

Conversation

@oferchen
Copy link
Copy Markdown
Owner

@oferchen oferchen commented May 2, 2026

Summary

  • Wires the existing metadata::acl_windows (Win32 GetNamedSecurityInfoW / SetNamedSecurityInfoW) implementation into the engine pipeline so --acls / -A now reaches the Windows code path.
  • Widens 99 cfg gates across 40 files in cli/core/engine/transfer from cfg(all(unix, feature = "acl")) to cfg(all(any(unix, windows), feature = "acl")). Tests/fixtures that drive raw libacl/exacl FFI remain unix-only.
  • Updates the preflight check and drive config so the Windows DACL dispatch is invoked instead of reporting "POSIX ACLs are not supported on this client".

Context

The metadata-layer Windows ACL implementation already existed (commit 9b3a07f) but was unreachable because every engine call site gated ACL handling on cfg(all(unix, feature = "acl")). SID-to-uid mapping follows upstream acls.c:902-928. SACLs are intentionally skipped (require SE_SECURITY_NAME privilege).

Test plan

  • CI fmt + clippy
  • CI nextest (stable) on Linux, macOS, Windows
  • CI Linux musl
  • Manual: oc-rsync -aA src dst on Windows preserves DACL ACEs across copy

Refs #1866

The Windows ACL implementation in `metadata::acl_windows` was previously
unreachable because every engine and CLI call site gated invocation on
`cfg(all(unix, feature = "acl"))`. This widens the gates to
`cfg(all(any(unix, windows), feature = "acl"))` so `--acls`/`-A` now
flows through to the Win32 `GetNamedSecurityInfoW` /
`SetNamedSecurityInfoW` paths on Windows.

Scope:
- engine local_copy executor (file, special, directory recursion)
- engine `sync_acls_if_requested` and metadata-sync helpers
- engine `LocalCopyOptions` setters / accessors / builder validation
- core client config builder, run, remote invocation, flags
- cli drive workflow, preflight feature validation, drive config
- transfer flag emission

Tests/fixtures that drive raw libacl / exacl FFI directly remain
unix-only intentionally; only dispatch through `metadata::sync_acls`
gains the Windows code path.

Refs #1866
@github-actions github-actions Bot added the enhancement New feature or request label May 2, 2026
oferchen added 3 commits May 2, 2026 11:25
The mode parameter and LocalCopyExecution import in
apply_final_directory_metadata were gated on
`all(unix, any(feature = "acl", feature = "xattr"))`,
but the call site for sync_acls_if_requested is gated on
`all(any(unix, windows), feature = "acl")`. When building
on Windows with the acl feature enabled (without xattr),
`mode` was not in scope, causing E0425 in CI.

Widen both gates to also include `all(windows, feature = "acl")`
so the Windows + acl combination compiles.
The callee apply_final_directory_metadata accepts `mode` under
`any(unix+acl|xattr, windows+acl)` but the caller was passing it under
the narrower `unix+acl|xattr` gate. On windows+acl the call passed 5
args instead of 6, causing E0061.

Match the caller's gate to the callee's.
@oferchen oferchen merged commit d8762d3 into master May 2, 2026
37 checks passed
@oferchen oferchen deleted the feat/windows-acl-engine-wiring branch May 2, 2026 13:01
oferchen added a commit that referenced this pull request May 5, 2026
#3558)

* feat(metadata): wire Windows ACL support through engine pipeline (#1866)

The Windows ACL implementation in `metadata::acl_windows` was previously
unreachable because every engine and CLI call site gated invocation on
`cfg(all(unix, feature = "acl"))`. This widens the gates to
`cfg(all(any(unix, windows), feature = "acl"))` so `--acls`/`-A` now
flows through to the Win32 `GetNamedSecurityInfoW` /
`SetNamedSecurityInfoW` paths on Windows.

Scope:
- engine local_copy executor (file, special, directory recursion)
- engine `sync_acls_if_requested` and metadata-sync helpers
- engine `LocalCopyOptions` setters / accessors / builder validation
- core client config builder, run, remote invocation, flags
- cli drive workflow, preflight feature validation, drive config
- transfer flag emission

Tests/fixtures that drive raw libacl / exacl FFI directly remain
unix-only intentionally; only dispatch through `metadata::sync_acls`
gains the Windows code path.

Refs #1866

* fix(engine): widen mode parameter cfg for windows+acl path

The mode parameter and LocalCopyExecution import in
apply_final_directory_metadata were gated on
`all(unix, any(feature = "acl", feature = "xattr"))`,
but the call site for sync_acls_if_requested is gated on
`all(any(unix, windows), feature = "acl")`. When building
on Windows with the acl feature enabled (without xattr),
`mode` was not in scope, causing E0425 in CI.

Widen both gates to also include `all(windows, feature = "acl")`
so the Windows + acl combination compiles.

* fix(engine): widen call-site cfg for windows+acl mode arg

The callee apply_final_directory_metadata accepts `mode` under
`any(unix+acl|xattr, windows+acl)` but the caller was passing it under
the narrower `unix+acl|xattr` gate. On windows+acl the call passed 5
args instead of 6, causing E0061.

Match the caller's gate to the callee's.
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