mafintosh/tar-fs

Error if and when the steam is not a valid tar file?

billxinli opened this issue · 4 comments

Hi:

Curious why an error is not emitted on invalid tar files?

echo "this is just a plain text file" > file.tar

var tarFs = require('tar-fs')
var fs = require('fs')

fs.createReadStream('./file.tar')
  .pipe(
    tarFs.extract('./test-o')
  )
  .on('error', function (err) {
    console.log(err);
  })
  .on('finish', function () {
    console.log('finished!');
  })

if will emit an error if the tar checksum fails but i guess your test file is too small (< 512b) so the header check never fires. we should fail is this case i agree.

Isn't this a bug on tar-stream? We should have a label for this ones...

Hey, looks like you fixed this issue at least for node >= 8: mafintosh/tar-stream@689d3fa

Should be fixed for all node actually