From nobody@FreeBSD.org  Sat Feb  1 06:20:12 2014
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 058C853C
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  1 Feb 2014 06:20:12 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id E5A9B123A
	for <freebsd-gnats-submit@FreeBSD.org>; Sat,  1 Feb 2014 06:20:11 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id s116KBMi020344
	for <freebsd-gnats-submit@FreeBSD.org>; Sat, 1 Feb 2014 06:20:11 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id s116KBj4020337;
	Sat, 1 Feb 2014 06:20:11 GMT
	(envelope-from nobody)
Message-Id: <201402010620.s116KBj4020337@oldred.freebsd.org>
Date: Sat, 1 Feb 2014 06:20:11 GMT
From: Gen Otsuji <gen_otsuji_aka_go@yahoo.co.jp>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [libarchive] tar error containing fisrt '/' char and hard links
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         186330
>Category:       kern
>Synopsis:       [libarchive] tar error containing fisrt '/' char and hard links
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 01 06:30:01 UTC 2014
>Closed-Date:    
>Last-Modified:  Mon Feb 03 10:51:52 UTC 2014
>Originator:     Gen Otsuji
>Release:        10.0-RELEASE
>Organization:
>Environment:
FreeBSD r10 10.0-STABLE FreeBSD 10.0-STABLE #0 r261305: Fri Jan 31 13:38:29 JST 2014 amd64
>Description:
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.


>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.

>Fix:
workaround:
 use gnu tar

>Release-Note:
>Audit-Trail:
>Unformatted:
