Bug 186330 - [libarchive] tar error containing fisrt '/' char and hard links
Summary: [libarchive] tar error containing fisrt '/' char and hard links
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.0-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-01 06:30 UTC by Gen Otsuji
Modified: 2017-12-31 22:27 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gen Otsuji 2014-02-01 06:30:01 UTC
When the archive to extract is containing the first character '/' in the paths ,
and containing hard link files, bsd tar cannot create the files.
Also notice this problem occurs on the different filesystems.

In the example below ,
 1) /bin/csh and /bin/tcsh are hard link.
 2) The reason why I write cd /tmp, /bin and /tmp are on the different filesystems.
 3) the test.cpio contains the first character '/' in the paths .

and this problem is not only in the cpio archive , but also in the tar archive as in the example below. so this is a bug in libarchive.

Fix: 

workaround:
 use gnu tar
How-To-Repeat: # echo tmpfs=YES >> /etc/rc.conf
# echo tmpsize=1g >> /etc/rc.conf
# service tmp start
# cd /tmp
# find /bin/csh /bin/tcsh | cpio -o > test.cpio
# tar xvpf test.cpio
tar: Removing leading '/' from member names
x bin/csh
x bin/tcsh: Can't create 'bin/tcsh'
tar: Error exit delayed from previous errors.
# tar xvpf test.cpio /bin/tcsh
tar: Removing leading '/' from member names
x bin/tcsh: Can't create 'bin/tcsh'
tar: Error exit delayed from previous errors.

# pkg fetch zsh-5.0.5
# tar xf /var/cache/pkg/All/zsh-5.0.5.txz -C /tmp
tar: Removing leading '/' from member names
usr/local/bin/rzsh: Can't create 'usr/local/bin/rzsh'
usr/local/bin/zsh-5.0.5: Can't create 'usr/local/bin/zsh-5.0.5'
tar: Error exit delayed from previous errors.
Comment 1 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:21 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped