Repository navigation
Align tests with explicit symlink preservation flag - #2142
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| non_empty_path(relative.as_path()), | ||
| root_device, | ||
| )?; | ||
| } else if file_type.is_symlink() && !context.copy_links_enabled() { | ||
| copy_symlink( | ||
| context, | ||
| source_path, | ||
| &target, | ||
| &metadata, | ||
| &metadata_options, | ||
| record_path, | ||
| )?; | ||
| } else if file_type.is_symlink() { | ||
| if context.links_enabled() && !context.copy_links_enabled() { | ||
| copy_symlink( | ||
| context, | ||
| source_path, | ||
| &target, | ||
| &metadata, | ||
| &metadata_options, | ||
| record_path, | ||
| )?; | ||
| } else if context.links_enabled() { | ||
| copy_symlink( | ||
| context, | ||
| source_path, | ||
| &target, | ||
| &metadata, | ||
| &metadata_options, | ||
| record_path, | ||
| )?; | ||
| } else { |
There was a problem hiding this comment.
copy-links no longer dereferences special symlink targets
The new links_enabled() gate in the symlink branch means the file_type.is_symlink() block now executes for every symlink before the FIFO/device branches are considered, regardless of whether --copy-links was supplied. When copy_links is true and the symlink points to something other than a file/dir (e.g. a FIFO or device), the code at lines 289‑308 either preserves the symlink (if --links is in effect via -a) or skips it entirely (when --links is absent), and the subsequent is_fifo(&effective_type)/is_device(&effective_type) branches are never reached. Before this commit the symlink branch was guarded by !context.copy_links_enabled(), so --copy-links correctly dereferenced these entries. As a result, oc-rsync --copy-links src dest no longer copies the referent when the symlink targets a FIFO/device, which is a regression of the flag’s semantics.
Useful? React with 👍 / 👎.
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at compat.c:777-778 when both peers advertise the 'I' capability char). With that bit set, the receiver enables per-file inplace for basis files retrieved from the partial directory, so the otherwise conflicting --inplace/--append plus --partial-dir combination runs successfully. Add ClientConfigBuilder::validate_with_capabilities alongside the strict validate() default. The capability-aware variant accepts the pair when the negotiated bitfield contains CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the upstream parse-time rejection (options.c:2406-2414) for callers that have not yet seen the negotiated bits. Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and combined with CF_INC_RECURSE (0x41) so future varint refactors cannot silently drift from upstream's write_varint payload. Resolves G2 in docs/audits/compatibility-flags-mutual-exclusion-matrix.md. Refs #2142, #2143, #2144.
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at compat.c:777-778 when both peers advertise the 'I' capability char). With that bit set, the receiver enables per-file inplace for basis files retrieved from the partial directory, so the otherwise conflicting --inplace/--append plus --partial-dir combination runs successfully. Add ClientConfigBuilder::validate_with_capabilities alongside the strict validate() default. The capability-aware variant accepts the pair when the negotiated bitfield contains CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the upstream parse-time rejection (options.c:2406-2414) for callers that have not yet seen the negotiated bits. Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and combined with CF_INC_RECURSE (0x41) so future varint refactors cannot silently drift from upstream's write_varint payload. Resolves G2 in docs/audits/compatibility-flags-mutual-exclusion-matrix.md. Refs #2142, #2143, #2144.
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at compat.c:777-778 when both peers advertise the 'I' capability char). With that bit set, the receiver enables per-file inplace for basis files retrieved from the partial directory, so the otherwise conflicting --inplace/--append plus --partial-dir combination runs successfully. Add ClientConfigBuilder::validate_with_capabilities alongside the strict validate() default. The capability-aware variant accepts the pair when the negotiated bitfield contains CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the upstream parse-time rejection (options.c:2406-2414) for callers that have not yet seen the negotiated bits. Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and combined with CF_INC_RECURSE (0x41) so future varint refactors cannot silently drift from upstream's write_varint payload. Resolves G2 in docs/audits/compatibility-flags-mutual-exclusion-matrix.md. Refs #2142, #2143, #2144.
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at compat.c:777-778 when both peers advertise the 'I' capability char). With that bit set, the receiver enables per-file inplace for basis files retrieved from the partial directory, so the otherwise conflicting --inplace/--append plus --partial-dir combination runs successfully. Add ClientConfigBuilder::validate_with_capabilities alongside the strict validate() default. The capability-aware variant accepts the pair when the negotiated bitfield contains CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the upstream parse-time rejection (options.c:2406-2414) for callers that have not yet seen the negotiated bits. Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and combined with CF_INC_RECURSE (0x41) so future varint refactors cannot silently drift from upstream's write_varint payload. Resolves G2 in docs/audits/compatibility-flags-mutual-exclusion-matrix.md. Refs #2142, #2143, #2144.
Upstream rsync 3.4.1 negotiates the CF_INPLACE_PARTIAL_DIR capability bit (compat.c:117 `#define CF_INPLACE_PARTIAL_DIR (1<<6)`, enabled at compat.c:777-778 when both peers advertise the 'I' capability char). With that bit set, the receiver enables per-file inplace for basis files retrieved from the partial directory, so the otherwise conflicting --inplace/--append plus --partial-dir combination runs successfully. Add ClientConfigBuilder::validate_with_capabilities alongside the strict validate() default. The capability-aware variant accepts the pair when the negotiated bitfield contains CompatibilityFlags::INPLACE_PARTIAL_DIR; the strict default keeps the upstream parse-time rejection (options.c:2406-2414) for callers that have not yet seen the negotiated bits. Pin the wire encoding for CF_INPLACE_PARTIAL_DIR alone (0x40) and combined with CF_INC_RECURSE (0x41) so future varint refactors cannot silently drift from upstream's write_varint payload. Resolves G2 in docs/audits/compatibility-flags-mutual-exclusion-matrix.md. Refs #2142, #2143, #2144.
Summary
--linksso list output still shows targets.links(true)in symlink-focused client tests and integration test to match new defaultlinksfield in the fallback test fixtureTesting
[Codex Task](