[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Bug-tar] Tar --verify causes next tar command to overwrite filemark
From: |
Andrew Klaassen |
Subject: |
Re: [Bug-tar] Tar --verify causes next tar command to overwrite filemark |
Date: |
Tue, 11 Dec 2007 08:17:25 -0800 (PST) |
The behaviour with the patch appears to be the same as
the behaviour without the patch:
# mt rewind
# ./tar cf /dev/nst0 foo
# mt status | grep ^File
File number=1, block number=0, partition=0.
# mt rewind
# ./tar cWf /dev/nst0 foo
# mt status | grep ^File
File number=0, block number=1, partition=0.
Andrew
--- Sergey Poznyakoff <address@hidden> wrote:
> Andrew Klaassen <address@hidden> ha escrit:
>
> > 'tar cWf' leaves the tape in a different position
> than
> > 'tar cf' does. Compare the expected behaviour to
> the
>
> Could you test the following patch, please? It is
> made against CVS
> and should apply to v.19 cleanly.
>
> Regards,
> Sergey
>
> Index: src/compare.c
>
===================================================================
> RCS file: /cvsroot/tar/tar/src/compare.c,v
> retrieving revision 1.40
> diff -p -u -r1.40 compare.c
> --- src/compare.c 26 Aug 2007 09:01:08 -0000 1.40
> +++ src/compare.c 11 Dec 2007 15:55:20 -0000
> @@ -597,9 +597,20 @@ verify_volume (void)
> "VERIFY FAILURE: %d invalid headers
> detected",
> counter), counter));
> }
> - if (status == HEADER_ZERO_BLOCK || status ==
> HEADER_END_OF_FILE)
> + if (status == HEADER_END_OF_FILE)
> break;
> -
> + if (status == HEADER_ZERO_BLOCK)
> + {
> + char buf[UINTMAX_STRSIZE_BOUND];
> +
> + set_next_block_after (current_header);
> + status = read_header (false);
> + if (status == HEADER_ZERO_BLOCK)
> + break;
> + WARN ((0, 0, _("A lone zero block at %s"),
> + STRINGIFY_BIGINT (current_block_ordinal (),
> buf)));
> + }
> +
> diff_archive ();
> tar_stat_destroy (¤t_stat_info);
> }
>
____________________________________________________________________________________
Looking for last minute shopping deals?
Find them fast with Yahoo! Search.
http://tools.search.yahoo.com/newsearch/category.php?category=shopping