From eserte@cabulja.herceg.de  Thu Apr 10 09:24:04 1997
Received: from cabulja.herceg.de (dial1-05.zrz.TU-Berlin.DE [130.149.1.165])
          by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id JAA16052
          for <FreeBSD-gnats-submit@FreeBSD.ORG>; Thu, 10 Apr 1997 09:24:00 -0700 (PDT)
Received: (from eserte@localhost)
	by cabulja.herceg.de (8.8.5/8.8.5) id PAA01185;
	Thu, 10 Apr 1997 15:27:40 +0200 (CEST)
Message-Id: <199704101327.PAA01185@cabulja.herceg.de>
Date: Thu, 10 Apr 1997 15:27:40 +0200 (CEST)
From: eserte@cs.tu-berlin.de
Reply-To: eserte@cs.tu-berlin.de
To: freefall-gnats@cabulja.herceg.de
Subject: tar -O creates directories
X-Send-Pr-Version: 3.2

>Number:         3247
>Category:       gnu
>Synopsis:       tar -O creates directories
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 10 09:30:02 PDT 1997
>Closed-Date:    Sun Apr 13 10:39:55 MET DST 1997
>Last-Modified:  Sun Apr 13 10:40:20 MET DST 1997
>Originator:     Slaven Rezic
>Release:        FreeBSD 2.2.1-RELEASE i386
>Organization:
Private FreeBSD site, Berlin, Germany
>Environment:

>Description:

	tar -O creates directories. Since -O extracts files to
	standard output, I think that no directories should be
	created. 

>How-To-Repeat:

	tar xfvOz something.tar.gz

>Fix:
	
	Maybe there's a newer version of GNU tar with the bug already
	fixed?

>Release-Note:
>Audit-Trail:

From: Slaven Rezic <eserte@cs.tu-berlin.de>
To: joerg_wunsch@uriah.heep.sax.de
Cc: freefall-gnats@cabulja.herceg.de
Subject: Re: gnu/3247: tar -O creates directories
Date: Sun, 13 Apr 1997 04:59:12 +0200 (CEST)

 > 
 > As eserte@cs.tu-berlin.de wrote:
 > 
 > > 	tar -O creates directories. Since -O extracts files to
 > > 	standard output, I think that no directories should be
 > > 	created. 
 > 
 > Not confirmed:
 > 
 > j@uriah 98% mkdir -p foo/bar
 > j@uriah 99% echo hi > foo/hi
 > j@uriah 100% echo lo > foo/bar/lo
 > j@uriah 101% tar -cvzf foobar.tar.gz foo
 > foo/
 > foo/bar/
 > foo/bar/lo
 > foo/hi
 > j@uriah 102% rm -rf foo
 > j@uriah 103% tar -xOzf foobar.tar.gz foo/hi
 > hi
 > j@uriah 104% tar -xOzf foobar.tar.gz foo/bar/lo
 > lo
 > j@uriah 105% ls -lR foo bar
 > ls: bar: No such file or directory
 > ls: foo: No such file or directory
 
 Jrg, try:
 
 4:55 eserte@cabulja 301 (/tmp): tar -xOzf foobar.tar.gz > /dev/null
 4:56 eserte@cabulja 302 (/tmp): ls -lR foo bar
 ls: bar: No such file or directory
 foo:
 total 1
 drwxrwx--x  2 eserte  wheel  512 13 Apr 04:54 bar/
 
 foo/bar:
 Exit 1
 
 Gru,
 	Slaven
 
 -- 
 Slaven Rezi (Tomi)          IPA: /'slavEn 'Re:ziC 'tOmIC/
   e-mail: <URL:mailto:eserte@cs.tu-berlin.de>
   WWW:    <URL:http://user.cs.tu-berlin.de/~eserte/>
   Accept-language: de;q=1, hr;q=0.97, en;q=0.9, fr;q=0.2

From: j@uriah.heep.sax.de (J Wunsch)
To: eserte@cs.tu-berlin.de
Cc: freebsd-gnats-submit@freebsd.org
Subject: Re: gnu/3247: tar -O creates directories
Date: Sun, 13 Apr 1997 09:58:05 +0200

 As Slaven Rezic wrote:
 
 > Jrg, try:
 > 
 > 4:55 eserte@cabulja 301 (/tmp): tar -xOzf foobar.tar.gz > /dev/null
 > 4:56 eserte@cabulja 302 (/tmp): ls -lR foo bar
 
 Ah, now i understand what's going on... btw., it did extract even more
 junk, for example symlinks, to the disk.  The following should fix it:
 
 Index: tar/extract.c
 ===================================================================
 RCS file: /home/cvs/src/gnu/usr.bin/tar/extract.c,v
 retrieving revision 1.4
 diff -u -u -r1.4 extract.c
 --- extract.c	1996/11/03 14:47:51	1.4
 +++ extract.c	1997/04/13 07:54:18
 @@ -158,7 +158,10 @@
    userec (head);		/* And go past it in the archive */
    decode_header (head, &hstat, &head_standard, 1);	/* Snarf fields */
  
 -  if (f_confirm && !confirm ("extract", current_file_name))
 +  if ((f_confirm && !confirm ("extract", current_file_name)) ||
 +      (f_exstdout && head->header.linkflag != LF_OLDNORMAL &&
 +       head->header.linkflag != LF_NORMAL &&
 +       head->header.linkflag != LF_CONTIG))
      {
        if (head->header.isextended)
  	skip_extended_headers ();
 
 
 p.s.: please avoid putting invalid addresses into your outgoing mail
 headers (Cc in this case).  That's why sendmail offers you the feature
 to rewrite the headers. :-}
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)
State-Changed-From-To: open->closed 
State-Changed-By: joerg 
State-Changed-When: Sun Apr 13 10:39:55 MET DST 1997 
State-Changed-Why:  
Fixed in: 
/home/ncvs/src/gnu/usr.bin/tar/extract.c,v  <--  extract.c 
new revision: 1.5; previous revision: 1.4 
done 

>Unformatted:
 
