node-tar
node-tar copied to clipboard
[BUG] Crash when extracting file with hardlink to itself
See https://github.com/devcontainers/cli/issues/699 for details
/workspaces/cli/dist/spec-node/devContainersSpecCLI.js:6107
return paths.every((q) => q[0] === fn) && dirs.every((q) => q[0] instanceof Set && q[0].has(fn));
^
TypeError: Cannot read properties of undefined (reading '0')
Root cause: https://github.com/devcontainers/cli/issues/699#issuecomment-1857028310
Why do we have these?
This happens if a file is specified multiple times indirectly by the directory when it is created. https://github.com/libarchive/libarchive/issues/1381#issuecomment-635066671 Apparently both GNU tar and libarchive just ignore this kind of silly links instead of fixing the problem. It's stupid but might want to do the same for compatibility.