mirror of
https://github.com/nvm-sh/nvm.git
synced 2026-11-30 12:40:11 +03:00
`--strip-components 1` (and OpenBSD's `-s` equivalent) rewrites each name after the extracting tar has checked it, so with tars that have no `openat2` jail (upstream GNU tar, busybox tar without its traversal protection) a member named `node-v…//home/user/.bashrc` was written to `/home/user/.bashrc`, and a hard link to `node-v…//abs/path` linked that file into the install tree, both silently and with a zero exit. Extract the archive as-is into a sibling staging directory, require exactly one top-level entry that is a real directory, and rename it into place; dotfiles in the archive are kept. busybox tar does not contain hard link targets at all (absolute, `..`, or through an earlier symlink member), so refuse any extracted file with more than one link. No node.js or io.js archive contains a hard link.