Bug 14664

Summary: tar checks for volno-file even if it shouldn't
Product: Base System Reporter: Andre Albsmeier <Andre.Albsmeier>
Component: gnuAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Andre Albsmeier 1999-11-02 19:00:01 UTC
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.

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.
	
How-To-Repeat: 
See above.
Comment 1 Sheldon Hearn 1999-11-03 08:31:35 UTC
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.
Comment 2 Andre Albsmeier 1999-11-03 09:30:52 UTC
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
Comment 3 Sheldon Hearn 1999-11-03 09:37:42 UTC
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.
Comment 4 Andre Albsmeier 1999-11-03 09:41:43 UTC
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
Comment 5 Maxim Sobolev freebsd_committer freebsd_triage 2002-06-04 18:49:05 UTC
State Changed
From-To: open->patched

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.
Comment 6 Johan Karlsson freebsd_committer freebsd_triage 2002-08-22 18:16:51 UTC
State Changed
From-To: patched->closed

GNU tar 1.13.25 has been MFCed.