Bug 11026 - tar: cannot extract hardlinked possibly-unsafe symlinks
Summary: tar: cannot extract hardlinked possibly-unsafe symlinks
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.28.x
Hardware: All Linux
: P5 normal
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-19 09:36 UTC by Harald van Dijk
Modified: 2018-05-22 15:39 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Harald van Dijk 2018-05-19 09:36:37 UTC
Test case:

mkdir dir
>dir/a
ln -s ../dir/a dir/b
ln dir/b dir/c
mkdir new
tar cf - dir/* | tar -C new -xf -

Expected result:

Successful extraction.

Actual result:

tar: can't create hardlink 'dir/c' to 'dir/b': No such file or directory

Re-tested with current master (2ccd3522816291bd7e3ede3f60370d725d86e179)

I sent a patch for this to the mailing list on April 1 (after a botched attempt at a fix the day before) and followed up a few times:

http://lists.busybox.net/pipermail/busybox/2018-April/086346.html

I am submitting it as a bug now so that I do not have to keep pinging it.
Comment 1 Denys Vlasenko 2018-05-22 15:39:03 UTC
Fixed in git.