Skip to content

Commit

Permalink
Fixes arbitrary file write on fetch (#7831)
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanis authored Jan 31, 2020
1 parent fa613f3 commit 0e7133c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/fetchers/tarball-fetcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ export default class TarballFetcher extends BaseFetcher {
chown: false, // don't chown. just leave as it is
map: header => {
header.mtime = now;
if (header.linkname) {
const basePath = path.posix.dirname(path.join('/', header.name));
const jailPath = path.posix.join(basePath, header.linkname);
header.linkname = path.posix.relative('/', jailPath);
}
return header;
},
fs: patchedFs,
Expand Down

0 comments on commit 0e7133c

Please sign in to comment.