Skip to content

Copy the target when DirectoryArchiver cannot create a symbolic link - #509

Merged
slachiewicz merged 1 commit into
4.xfrom
agent/symlink-failure-mode-dir
Oct 13, 2026
Merged

slachiewicz merged 1 commit into
4.xfrom
agent/symlink-failure-mode-dir

Conversation

@slachiewicz

Copy link
Copy Markdown
Member

Stacked on #507. DirectoryArchiver (the assembly dir format) had the same unguarded SymlinkUtils.createSymbolicLink call, so it failed the same way on Windows without the symlink privilege. It gets the same SymlinkFailureMode, default COPY_TARGET, and the second pass moves into DeferredSymlinks, shared with AbstractUnArchiver.

Copying the resource content instead is not enough: a symlink entry from an archived file set has no content, so that would write empty files.

Verified: mvn verify → 360 tests, 0 failures; without the resolve() call the copy test fails.

@slachiewicz slachiewicz added the bug Something isn't working label Oct 13, 2026
Base automatically changed from agent/symlink-failure-mode to 4.x October 13, 2026 20:15
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 force-pushed the agent/symlink-failure-mode-dir branch from 2e1b95b to 51ef24c Compare October 13, 2026 20:15
@slachiewicz
slachiewicz marked this pull request as ready for review October 13, 2026 20:16
@slachiewicz
slachiewicz merged commit 8e3ba79 into 4.x Oct 13, 2026
16 checks passed
@slachiewicz
slachiewicz deleted the agent/symlink-failure-mode-dir branch October 13, 2026 20:25
slachiewicz added a commit that referenced this pull request Oct 18, 2026
The next 4.x release adds the SymlinkFailureMode API (#507, #509), so it is a minor release.
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.

1 participant