summaryrefslogtreecommitdiff
path: root/cli/npm
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2022-08-30 17:15:41 +0200
committerGitHub <noreply@github.com>2022-08-30 17:15:41 +0200
commit54be07d05e4c763dfa1b612decc58fa234aa9c88 (patch)
treeaff5ac218406c906f81e1dc1e344a8d4cfff0712 /cli/npm
parentf3a0e48d4ecb7624bb8c19f0588504cd6249089b (diff)
fix(npm): skip extracting pax_global_header from tarballs (#15677)
Diffstat (limited to 'cli/npm')
-rw-r--r--cli/npm/tarball.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/npm/tarball.rs b/cli/npm/tarball.rs
index f6fcb27bf..33e4faa69 100644
--- a/cli/npm/tarball.rs
+++ b/cli/npm/tarball.rs
@@ -123,6 +123,13 @@ fn extract_tarball(data: &[u8], output_folder: &Path) -> Result<(), AnyError> {
let mut entry = entry?;
let path = entry.path()?;
let entry_type = entry.header().entry_type();
+
+ // Some package tarballs contain "pax_global_header", these entries
+ // should be skipped.
+ if entry_type == EntryType::XGlobalHeader {
+ continue;
+ }
+
// skip the first component which will be either "package" or the name of the package
let relative_path = path.components().skip(1).collect::<PathBuf>();
let absolute_path = output_folder.join(relative_path);