Skip to content

Commit

Permalink
take symlinks into account when expanding archives and checking entries
Browse files Browse the repository at this point in the history
  • Loading branch information
bodewig committed Jul 1, 2018
1 parent 6a41d62 commit 5a8c37b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/org/apache/tools/ant/taskdefs/Expand.java
Original file line number Diff line number Diff line change
Expand Up @@ -333,9 +333,9 @@ protected void extractFile(FileUtils fileUtils, File srcF, File dir,
mappedNames = new String[] {entryName};
}
File f = fileUtils.resolveFile(dir, mappedNames[0]);
if (!allowedOutsideOfDest && !fileUtils.isLeadingPath(dir, f)) {
log("skipping " + entryName + " as its target " + f + " is outside of "
+ dir + ".", Project.MSG_VERBOSE);
if (!allowedOutsideOfDest && !fileUtils.isLeadingPath(dir, f, true)) {
log("skipping " + entryName + " as its target " + f.getCanonicalPath()
+ " is outside of " + dir.getCanonicalPath() + ".", Project.MSG_VERBOSE);
return;
}

Expand Down

0 comments on commit 5a8c37b

Please sign in to comment.