Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] Ensure extracted files are readable, update tar-fs #1548

Merged
merged 1 commit into from
Sep 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/util/extract.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ function extractTar(archive, dst) {
fs.createReadStream(archive)
.on('error', deferred.reject)
.pipe(tar.extract(dst, {
ignore: isSymlink // Filter symlink files
ignore: isSymlink, // Filter symlink files
dmode: 0555, // Ensure dirs are readable
fmode: 0444 // Ensure files are readable
}))
.on('error', deferred.reject)
.on('finish', deferred.resolve.bind(deferred, dst));
Expand All @@ -68,7 +70,9 @@ function extractTarGz(archive, dst) {
.pipe(zlib.createGunzip())
.on('error', deferred.reject)
.pipe(tar.extract(dst, {
ignore: isSymlink // Filter symlink files
ignore: isSymlink, // Filter symlink files
dmode: 0555, // Ensure dirs are readable
fmode: 0444 // Ensure files are readable
}))
.on('error', deferred.reject)
.on('finish', deferred.resolve.bind(deferred, dst));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"semver": "~2.3.0",
"shell-quote": "~1.4.1",
"stringify-object": "~1.0.0",
"tar-fs": "0.5.2",
"tar-fs": "~1.0.0",
"tmp": "0.0.23",
"update-notifier": "0.2.0",
"which": "~1.0.5"
Expand Down