Skip to content

Commit 4f98cc0

Browse files
committed
Auto merge of #1098 - ranma42:safe-untar, r=brson
Update tar and use new safe unpacking function The `unpack_in` function automatically handles the creation of the directories and validates the path name, but it is only available since version 0.4.11 of the `tar` crate. This is the rustup side of fixing #1092.
2 parents 7b3e8fb + 5ae90c4 commit 4f98cc0

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/rustup-dist/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ regex = "0.1.41"
1717
itertools = "0.4.1"
1818
ole32-sys = "0.2.0"
1919
url = "1.1.0"
20-
tar = "0.4.0"
20+
tar = "0.4.11"
2121
flate2 = "0.2.9"
2222
tempdir = "0.3.4"
2323
walkdir = "0.1.5"

src/rustup-dist/src/component/package.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ fn unpack_without_first_dir<R: Read>(archive: &mut tar::Archive<R>, path: &Path)
199199
// Throw away the first path component
200200
components.next();
201201
let full_path = path.join(&components.as_path());
202-
try!(entry.unpack(&full_path).chain_err(|| ErrorKind::ExtractingPackage));
202+
try!(entry.unpack_in(&full_path).chain_err(|| ErrorKind::ExtractingPackage));
203203
}
204204

205205
Ok(())

src/rustup-mock/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ walkdir = "0.1.5"
1717
flate2 = "0.2.9"
1818
tempdir = "0.3.4"
1919
itertools = "0.4.1"
20-
tar = "0.4.0"
20+
tar = "0.4.11"
2121
toml = "0.1.27"
2222
rustup-utils = { path = "../rustup-utils" }
2323
sha2 = "0.1.2"

0 commit comments

Comments
 (0)