From andre.albsmeier@mchp.siemens.de Tue Nov  2 10:50:05 1999
Return-Path: <andre.albsmeier@mchp.siemens.de>
Received: from thoth.mch.sni.de (thoth.mch.sni.de [192.35.17.2])
	by hub.freebsd.org (Postfix) with ESMTP id 613D514CE8
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  2 Nov 1999 10:49:57 -0800 (PST)
	(envelope-from andre.albsmeier@mchp.siemens.de)
Received: from mail2.siemens.de (mail2.siemens.de [139.25.208.11])
	by thoth.mch.sni.de (8.9.3/8.9.3) with ESMTP id TAA26879
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 2 Nov 1999 19:49:55 +0100 (MET)
Received: from curry.mchp.siemens.de (curry.mchp.siemens.de [139.25.42.7])
	by mail2.siemens.de (8.9.3/8.9.3) with ESMTP id TAA06838
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 2 Nov 1999 19:49:55 +0100 (MET)
Received: (from daemon@localhost)
	by curry.mchp.siemens.de (8.9.3/8.9.3) id TAA28329
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 2 Nov 1999 19:49:54 +0100 (CET)
Message-Id: <199911021849.TAA28716@internal>
Date: Tue, 2 Nov 1999 19:49:53 +0100 (CET)
From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: FreeBSD-gnats-submit@freebsd.org
Subject: tar checks for volno-file even if it shouldn't
X-Send-Pr-Version: 3.2

>Number:         14664
>Category:       gnu
>Synopsis:       tar checks for volno-file even if it shouldn't
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Nov  2 11:00:01 PST 1999
>Closed-Date:    Thu Aug 22 10:17:51 PDT 2002
>Last-Modified:  Thu Aug 22 10:17:51 PDT 2002
>Originator:     Andre Albsmeier
>Release:        FreeBSD 3.3-STABLE i386
>Organization:
>Environment:

Probably all FreeBSD versions, patch ist for -STABLE

>Description:

When using tar with the -F option but without --volno-file, the following
output appears after the first volume is full:

root@server:/dump>tar -c -F /dump/volchange -L 10 -f try.tar usr
tar: (null) : Bad address

This is because the code to modify the volno-file is called even if
there hasn't been one specified.


>How-To-Repeat:

See above.


>Fix:

The fix does the same thing as being done elsewhere when volno-file is
accessed: Do it only if the user specified --volno-file.
	
--- gnu/usr.bin/tar/buffer.c.ORI	Tue Nov  2 19:37:05 1999
+++ gnu/usr.bin/tar/buffer.c	Tue Nov  2 19:41:07 1999
@@ -1434,7 +1434,8 @@
       /* We have to prompt from now on. */
       if (f_run_script_at_end)
 	{
-	  closeout_volume_number ();
+	  if (f_volno_file)
+	    closeout_volume_number ();
 	  system (info_script);
 	}
       else

>Release-Note:
>Audit-Trail:

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: gnu/14664: tar checks for volno-file even if it shouldn't 
Date: Wed, 03 Nov 1999 10:31:35 +0200

 On Tue, 02 Nov 1999 19:49:53 +0100, Andre Albsmeier wrote:
 
 > -	  closeout_volume_number ();
 > +	  if (f_volno_file)
 > +	    closeout_volume_number ();
 
 If you got this change from the GNU tar maintainers, then we should
 probably commit it.  If it's something you came up with yourself, you
 should report it to the GNU tar maintainers and let me know; I'll
 suspend your PR and wait for you to open a new one when you have
 something "official" from the GNU tar maintainers.
 
 Ciao,
 Sheldon.
 

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: Sheldon Hearn <sheldonh@uunet.co.za>
Cc: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>,
	FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: gnu/14664: tar checks for volno-file even if it shouldn't
Date: Wed, 3 Nov 1999 10:30:52 +0100

 On Wed, 03-Nov-1999 at 10:31:35 +0200, Sheldon Hearn wrote:
 > 
 > 
 > On Tue, 02 Nov 1999 19:49:53 +0100, Andre Albsmeier wrote:
 > 
 > > -	  closeout_volume_number ();
 > > +	  if (f_volno_file)
 > > +	    closeout_volume_number ();
 > 
 > If you got this change from the GNU tar maintainers, then we should
 > probably commit it.  If it's something you came up with yourself, you
 
 I came up with it myself.
 
 
 > should report it to the GNU tar maintainers and let me know; I'll
 > suspend your PR and wait for you to open a new one when you have
 > something "official" from the GNU tar maintainers.
 
 I decided to look in tar-1.12.tar.gz from a gnu site before sending
 mail to bug-gnu-utils and, look, here the fix can be found already:
 
 buffer.c, around line 1555:
 
 ------------------------- snip ------------------------------
 
       if (info_script_option)
         {   
           if (volno_file_option)
             closeout_volume_number ();
           system (info_script_option);
         }
 
 ------------------------- snap ------------------------------
 
 
 The corresponding ChangeLog:
 
 ------------------------- snip ------------------------------
 1996-04-23  Fran\xe7ois Pinard  <pinard@iro.umontreal.ca>
 
         ...
 
         * buffer.c (new_volume): Avoid calling closeout_volume_number if
         the --volno-file option was not specified, so avoiding crashes.
 
 ------------------------- snap ------------------------------
 
 
 I think it would be the best to update the whole tar (since there are
 lots more bug fixes) but until this had been done, you could commit my fix.
 
 Thanks,
 
 	-Andre
 

From: Sheldon Hearn <sheldonh@uunet.co.za>
To: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: gnu/14664: tar checks for volno-file even if it shouldn't 
Date: Wed, 03 Nov 1999 11:37:42 +0200

 On Wed, 03 Nov 1999 10:30:52 +0100, Andre Albsmeier wrote:
 
 > I think it would be the best to update the whole tar (since there are
 > lots more bug fixes) but until this had been done, you could commit my
 > fix.
 
 No, if anything is to be committed in the interrim, it should be as
 close to the version used by the later release of GNU tar as possible.
 
 As you said, though, I think tar will be upgraded soon.
 
 Thanks,
 Sheldon.
 

From: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>
To: Sheldon Hearn <sheldonh@uunet.co.za>
Cc: Andre Albsmeier <andre.albsmeier@mchp.siemens.de>,
	FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: gnu/14664: tar checks for volno-file even if it shouldn't
Date: Wed, 3 Nov 1999 10:41:43 +0100

 On Wed, 03-Nov-1999 at 11:37:42 +0200, Sheldon Hearn wrote:
 > 
 > 
 > On Wed, 03 Nov 1999 10:30:52 +0100, Andre Albsmeier wrote:
 > 
 > > I think it would be the best to update the whole tar (since there are
 > > lots more bug fixes) but until this had been done, you could commit my
 > > fix.
 > 
 > No, if anything is to be committed in the interrim, it should be as
 > close to the version used by the later release of GNU tar as possible.
 
 OK.
 
 > 
 > As you said, though, I think tar will be upgraded soon.
 
 That would be really good, I think, since I saw lots of bug fixes
 while looking through ChangeLog.
 
 > 
 > Thanks,
 > Sheldon.
 
 Thanks to you,
 
 	-Andre
 
State-Changed-From-To: open->patched 
State-Changed-By: sobomax 
State-Changed-When: Tue Jun 4 10:49:05 PDT 2002 
State-Changed-Why:  
Modern GNU tar which was just imported into the -CURRENT doesn't have this 
problem. Therefore, the problem will befilly resolved when tar upgrade is 
MFC'ed in about 1 month. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14664 
State-Changed-From-To: patched->closed 
State-Changed-By: johan 
State-Changed-When: Thu Aug 22 10:16:51 PDT 2002 
State-Changed-Why:  
GNU tar 1.13.25 has been MFCed. 

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