Skip to content

Fix fallback cache handling for cwd-dependent binaries#2180

Merged
oferchen merged 1 commit into
masterfrom
implement-rsync-3.4.1-parity-in-rust
Nov 20, 2025
Merged

Fix fallback cache handling for cwd-dependent binaries#2180
oferchen merged 1 commit into
masterfrom
implement-rsync-3.4.1-parity-in-rust

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • include the current working directory in fallback binary cache keys whenever relative paths or PATH entries depend on it
  • add regression tests covering explicit relative paths and PATH entries that reference the current directory

Testing

  • cargo test -p core --all-features

Codex Task

@oferchen oferchen merged commit 5708047 into master Nov 20, 2025
5 checks passed
@oferchen oferchen deleted the implement-rsync-3.4.1-parity-in-rust branch November 20, 2025 15:44
oferchen added a commit that referenced this pull request May 16, 2026
…4117)

Upstream rsync 3.4.1 emits exactly one DEBUG_GTE(ACL, 1) line in
`acls.c::default_perms_for_dir` (`acls.c:1133-1134`):

    "got ACL-based default perms %o for directory %s\n"

The function is invoked from the generator and receiver
(`generator.c:1337-1340`, `receiver.c:846-851`) once per unique parent
directory whenever `--acls` is on but `--perms` is off, so dest_mode()
can fold the parent's default ACL bits into newly-created children.

This change introduces the equivalent on the oc-rsync side:

- `crates/protocol/src/acl/trace.rs` - `trace_default_perms_for_dir`
  helper emitting the upstream-verbatim wording via `debug_log!`,
  with pinning tests covering the wire shape and level gating.
- `crates/metadata/src/acl_exacl.rs::default_perms_for_dir` - reads
  the directory's POSIX default ACL via `exacl::getfacl`, extracts
  the user/group/other entries (mirroring `rsync_acl_get_perms`),
  and fires the trace when a user_obj is present. Filesystem errors
  and absent default ACLs fall back to `ACCESSPERMS & ~umask` without
  emitting, matching upstream's silent fallback.
- Cross-platform stubs in `acl_noop.rs`, `acl_stub.rs`, and
  `acl_windows.rs` return the umask-derived default without emitting,
  matching upstream's `#ifdef SUPPORT_ACLS` guard.
- `crates/transfer/src/receiver/directory/creation.rs` invokes the
  helper from `create_directories` per unique new parent when
  `acls && !perms`, gated to the platforms where the exacl path is
  compiled.
- Unit tests in `acl_exacl.rs` assert the byte-exact emission against
  a real default ACL on Linux/FreeBSD and confirm the level-0 gate
  suppresses the line.
- `docs/audits/debug-flags-verbosity-matrix.md` rolls ACL from
  missing to impl, updates the G3 gap, and refreshes the insertion
  table to point at the wired call site.

Closes #2180.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant