Bug 11026

Summary: tar: cannot extract hardlinked possibly-unsafe symlinks
Product: Busybox Reporter: Harald van Dijk <bb>
Component: OtherAssignee: unassigned
Status: RESOLVED FIXED    
Severity: normal CC: busybox-cvs
Priority: P5    
Version: 1.28.x   
Target Milestone: ---   
Hardware: All   
OS: Linux   
Host: Target:
Build:

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.