Skip to content

Commit 6355e5d

Browse files
committed
Canonicalize parent path in ReadTrustedStep.isDescendant in case JENKINS_HOME is a symlink
1 parent c20a4ef commit 6355e5d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/jenkinsci/plugins/workflow/multibranch/ReadTrustedStep.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ private static boolean isDescendant(FilePath child, FilePath parent) throws IOEx
248248
if (child.isRemote() || parent.isRemote()) {
249249
throw new IllegalStateException();
250250
}
251-
return new File(child.getRemote()).getCanonicalFile().toPath().startsWith(parent.absolutize().getRemote());
251+
return new File(child.getRemote()).getCanonicalFile().toPath().startsWith(new File(parent.getRemote()).getCanonicalPath());
252252
}
253253

254254
private static final long serialVersionUID = 1L;

0 commit comments

Comments
 (0)