torsdagen den 9 oktober 2014 16.11.49 skrev Steinar H. Gunderson: > On Wed, Oct 08, 2014 at 07:08:33PM -0400, Chris Frey wrote: > > I think the strncmp() is important, but I don't know why TAR_CHECK_MAGIC > > is an option. There are a couple of notes in the ChangeLog regarding it, > > but it was before my time, and I don't know the reasons why. > > I agree strncmp() is important. The TAR_CHECK_MAGIC flag seems to be if the > client explicitly wants us to barf on unknown magic; that's something > different from figuring out if format A or B is used when we can handle > both.
I'm not sure about this. The tar files created by GNU tar seem to have the magic string "ustar" in place, even when run with -H oldgnu, -G or -g. The difference is that "ustar" is followed by two spaces, whereas in tar files created by libtar it's followed by a null character. Furthermore, incremental archives containing subdirectories contain "dumpdirs" (https://www.gnu.org/software/tar/manual/html_section/tar_94.html#SEC191), which libtar doesn't understand. Steinar, can you provide a pointer to the heuristic code in GNU tar that you mentioned, as well as a description of the test cases you've used? -- Magnus Holmgren holmg...@debian.org Debian Developer
signature.asc
Description: This is a digitally signed message part.