[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: |
Sergey Poznyakoff |
Subject: |
Re: [Bug-tar] Tar --verify causes next tar command to overwrite filemark |
Date: |
Tue, 11 Dec 2007 17:58:31 +0200 |
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);
}