From gabor@server.t-hosting.hu  Mon Sep 18 18:34:35 2006
Return-Path: <gabor@server.t-hosting.hu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 2687D16A407;
	Mon, 18 Sep 2006 18:34:35 +0000 (UTC)
	(envelope-from gabor@server.t-hosting.hu)
Received: from server.t-hosting.hu (server.t-hosting.hu [217.20.133.7])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 7914043D7D;
	Mon, 18 Sep 2006 18:34:34 +0000 (GMT)
	(envelope-from gabor@server.t-hosting.hu)
Received: from localhost (localhost [127.0.0.1])
	by server.t-hosting.hu (Postfix) with ESMTP id B3F7099DDF8;
	Mon, 18 Sep 2006 20:34:31 +0200 (CEST)
Received: from server.t-hosting.hu ([127.0.0.1])
	by localhost (server.t-hosting.hu [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id e58gz7WegBfL; Mon, 18 Sep 2006 20:34:31 +0200 (CEST)
Received: by server.t-hosting.hu (Postfix, from userid 1009)
	id 5A60E99DDF7; Mon, 18 Sep 2006 20:34:31 +0200 (CEST)
Message-Id: <20060918183431.5A60E99DDF7@server.t-hosting.hu>
Date: Mon, 18 Sep 2006 20:34:31 +0200 (CEST)
From: Gabor Kovesdan <gabor@FreeBSD.org>
Reply-To: Gabor Kovesdan <gabor@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc: Gabor Kovesdan <gabor@FreeBSD.org>
Subject: tar fails if the tarball has device nodes when jailed
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         103366
>Category:       bin
>Synopsis:       [jail] tar(1) fails if the tarball has device nodes when jailed
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    kientzle
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 18 18:40:14 GMT 2006
>Closed-Date:    Tue Sep 18 04:22:30 GMT 2007
>Last-Modified:  Tue Sep 18 04:22:30 GMT 2007
>Originator:     Gabor Kovesdan
>Release:        FreeBSD 6.1-RELEASE-p3 amd64
>Organization:
n/a
>Environment:
System: FreeBSD server.t-hosting.hu 6.1-RELEASE-p3 FreeBSD 6.1-RELEASE-p3 #0: Sat Aug 19 11:08:15 CEST 2006 root@server.t-hosting.hu:/usr/src/sys/amd64/compile/FREEBSD amd64

>Description:

When one try to extract a tarball that contains device nodes in a jailed environment, it
always fails, even if those device nodes are excluded with --exclude.

>How-To-Repeat:

Try to install emulators/linux_dist-gentoo-stage3 jailed. The port is good, the device nodes
are excluded when installing. It installs fine in a host environment, but when jailed, one
will get such messages:

/usr/bin/tar: ./dev/rd/c3d10p6: Cannot mknod: Operation not permitted
/usr/bin/tar: ./dev/rd/c4d19p5: Cannot mknod: Operation not permitted
/usr/bin/tar: ./dev/rd/c6d9p4: Cannot mknod: Operation not permitted
/usr/bin/tar: ./dev/rd/c6d28p2: Cannot mknod: Operation not permitted
/usr/bin/tar: ./dev/rd/c0d19: Cannot mknod: Operation not permitted
/usr/bin/tar: ./dev/rd/c2d10p3: Cannot mknod: Operation not permitted
/usr/bin/tar: ./dev/rd/c5d28p1: Cannot mknod: Operation not permitted
/usr/bin/tar: ./dev/rd/c3d3p3: Cannot mknod: Operation not permitted
/usr/bin/tar: ./dev/rd/c2d25p3: Cannot mknod: Operation not permitted
[...]

There is something weird between the jailed environment and tar. Since all of these
files are excluded from the extraction, it should just work silently.
This weirdness requires the mentioned package to be built manually from the port and it
might affect other areas as well.

>Fix:

Don't know.
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->kientzle 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Mon Sep 18 21:58:04 UTC 2006 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103366 

From: Tim Kientzle <tim@kientzle.com>
To: bug-followup@FreeBSD.org, gabor@FreeBSD.org
Cc:  
Subject: Re: bin/103366: tar fails if the tarball has device nodes when jailed
Date: Mon, 18 Sep 2006 20:50:36 -0700

 Are you sure the entries are really being excluded when you run
 this outside of a jail?  This looks like a bug in the --exclude
 handling.
 

From: =?ISO-8859-1?Q?G=E1bor_K=F6vesd=E1n?= <gabor@FreeBSD.org>
To: bug-followup@FreeBSD.org,  gabor@FreeBSD.org
Cc:  
Subject: Re: bin/103366: tar fails if the tarball has device nodes when jailed
Date: Sun, 24 Sep 2006 14:17:29 +0200

 Yes, I'm definitely sure. As I said, this port works unjailed. Those 
 files are not installed in that case.
 
 -- 
 Cheers,
 
 Gabor
 

From: Tim Kientzle <tim@kientzle.com>
To: bug-followup@FreeBSD.org, gabor@FreeBSD.org
Cc:  
Subject: Re: bin/103366: tar fails if the tarball has device nodes when jailed
Date: Sun, 04 Mar 2007 19:24:56 -0800

 Gabor,
 
 I'm not having much luck reproducing this.  Please try the following 
 both in and outside of the jail and let me know the results:
 
 /usr/bin/tar --version
 
 /usr/bin/tar -t --exclude=./dev -f 
 /usr/ports/distfiles/gentoo-linux/stage3-x86-2006.0.tar.bz2 | grep dev/
 
 Cheers,
 
 Tim Kientzle
State-Changed-From-To: open->feedback 
State-Changed-By: linimon 
State-Changed-When: Tue Apr 24 04:43:07 UTC 2007 
State-Changed-Why:  
Note that submitter was asked for feedback. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103366 
State-Changed-From-To: feedback->closed 
State-Changed-By: kientzle 
State-Changed-When: Tue Sep 18 04:21:09 UTC 2007 
State-Changed-Why:  
I believe this has been fixed in the recent round 
of libarchive/bsdtar updates. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=103366 
>Unformatted:
