Skip to content

Unify link extraction across RAR formats - #106

Merged
bitplane merged 1 commit into
masterfrom
fix/unified-link-extraction
Oct 26, 2026
Merged

bitplane merged 1 commit into
masterfrom
fix/unified-link-extraction

Conversation

@bitplane

Copy link
Copy Markdown
Owner

Legacy Unix symbolic links were extracted as regular files containing their targets. Add common file/link extraction callbacks and route CLI extraction through them, so RAR 2/4 links become real symlinks and RAR5 links use the same filesystem staging and publication path.

The library decodes legacy targets in the existing extraction pass, preserving solid history, CRC verification, cancellation, and workspace/output budgets. Existing byte-oriented APIs retain their behavior. The CLI keeps filename decoding and path policy at the filesystem boundary, avoids restoring metadata through symlinks, and preserves verified predecessors on later failures.

Legacy link targets remain native Unix bytes. The new link API rejects targets over 64 KiB; the CLI applies its existing restrictions on absolute and parent-relative link targets. The new extraction API recognizes links only in Unix-host records, matching UnRAR; existing BeOS inspection/readlink/rewrite behavior remains unchanged. Windows still requires symlink privileges, and the legacy format supplies no target-directory hint.

Closes #105

Validation:

  • Full library and CLI release suites: 2,999 passed, 17 ignored.
  • Revised link regression suite after review fixes: 6 passed.
  • Library without default features: 368 passed.
  • Workspace Clippy with warnings denied; formatting and diff checks.
  • Regression coverage includes solid/parallel/split extraction, CRC failures, cancellation, resource limits, existing destinations, native target bytes, metadata safety, and real UnRAR comparison.
  • Claude reviewed the plan before implementation and the completed diff. Compatibility and error-context findings were fixed; its follow-up found no remaining correctness issues.

Native Windows/macOS execution is covered by this PR’s CI.

Expose common file/link callbacks and route CLI extraction through one
filesystem adapter. Decode legacy Unix link targets in the existing
CRC-checked pass, preserving solid history, cancellation, and shared
workspace/output limits. Keep existing byte-oriented APIs unchanged.

Share filename resolution, staging, overwrite handling, and publication
between legacy and RAR5 extraction. Preserve native target bytes and avoid
restoring metadata through symbolic links. Cover split targets, failures,
resource limits, and UnRAR parity with regression tests.

Closes #105
@bitplane
bitplane merged commit 410f01c into master Oct 26, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CLI extracts RAR 1.5–4 Unix symbolic links as regular files

1 participant