tar-stream: Generated tar fails to be unpacked including a unicode directory with some specific pattern
The result.tar generated by the following codes fails to be unpacked,
const tar = require('tar-stream');
const writeStream = require('fs').createWriteStream('result.tar');
const pack = tar.pack();
pack.pipe(writeStream);
// the specific pattern I found:
// here, a '0' represents an ASCII character and a '哈' represents a unicode character
const directory = './0000000哈哈000哈哈0000哈哈00哈00哈0哈哈哈哈哈0哈/0000哈哈哈/';
const name = directory + 'somefile.txt';
const entry = pack.entry({ name }, 'any text', (...args) => console.log(args));
pack.finalize();
showing this after executing tar -xf result.tar
on terminal
tar: Ignoring malformed pax extended attribute tar: Error exit delayed from previous errors.
or something like this when double-clicked on Mac OS
Error 1: Operation not allowed
I’m working on Mac OS and have tried the codes on node of both version 6.9.1 and 7.5.0, producing the same result.
tar-stream
works perfectly with almost all other unicode patterns so I think there might be a bug?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (1 by maintainers)
Commits related to this issue
- Fix #66 - invalid pax header when length+digits is 100 — committed to nono/tar-stream by nono 7 years ago
@Mensu can you test with https://github.com/mafintosh/tar-stream/pull/77 ?