1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

fix(npm): skip extracting pax_global_header from tarballs (#15677)

This commit is contained in:
Bartek Iwańczuk 2022-08-30 17:15:41 +02:00 committed by GitHub
parent f3a0e48d4e
commit 54be07d05e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 26 additions and 0 deletions

View file

@ -123,6 +123,13 @@ fn extract_tarball(data: &[u8], output_folder: &Path) -> Result<(), AnyError> {
let mut entry = entry?; let mut entry = entry?;
let path = entry.path()?; let path = entry.path()?;
let entry_type = entry.header().entry_type(); 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 // 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 relative_path = path.components().skip(1).collect::<PathBuf>();
let absolute_path = output_folder.join(relative_path); let absolute_path = output_folder.join(relative_path);

View file

@ -110,6 +110,13 @@ itest!(sub_paths {
http_server: true, http_server: true,
}); });
itest!(tarball_with_global_header {
args: "run --unstable -A --quiet npm/tarball_with_global_header/main.js",
output: "npm/tarball_with_global_header/main.out",
envs: env_vars(),
http_server: true,
});
#[test] #[test]
fn parallel_downloading() { fn parallel_downloading() {
let (out, _err) = util::run_and_collect_output_with_args( let (out, _err) = util::run_and_collect_output_with_args(

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

@ -0,0 +1,3 @@
import { Client } from "npm:ssh2";
console.log(Client);

View file

@ -0,0 +1 @@
[Function: bound Client]