Skip to content

Copy the target when the file system refuses a symbolic link - #508

Merged
slachiewicz merged 2 commits into
masterfrom
agent/symlink-failure-mode-master
Oct 13, 2026
Merged

slachiewicz merged 2 commits into
masterfrom
agent/symlink-failure-mode-master

Conversation

@slachiewicz

@slachiewicz slachiewicz commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Forward-port of #507 and #509 to master; the two commits are cherry-picked unchanged. Fixes #506.

#493 rewrites the same block of AbstractUnArchiver.extractFile, so whichever lands second needs a small rebase there.

Verified: mvn verify on JDK 21 → 522 tests, 0 failures.

On Windows without the symlink privilege, extracting a symlink entry aborted the whole archive (#506). The new SymlinkFailureMode, COPY_TARGET by default, copies the target after all entries are extracted; FAIL keeps the old behaviour. Link creation itself is unchanged where the file system allows it.
@slachiewicz slachiewicz added the bug Something isn't working label Oct 13, 2026
DirectoryArchiver had the same unguarded link creation as the unarchivers, so a dir assembly of a tar holding symlinks failed on Windows without the privilege. The deferred copy moves to DeferredSymlinks, shared with AbstractUnArchiver; copying the resource content instead would write empty files for archived link entries.
@slachiewicz
slachiewicz marked this pull request as ready for review October 13, 2026 20:16
@slachiewicz
slachiewicz merged commit 79f1857 into master Oct 13, 2026
16 checks passed
@slachiewicz
slachiewicz deleted the agent/symlink-failure-mode-master branch October 13, 2026 20:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extracting a symlink entry fails on Windows without the symlink privilege

1 participant