Skip to content

Commit

Permalink
Merge pull request #6913 from luiseufrasio/FISH-9186-doc-root-not-wor…
Browse files Browse the repository at this point in the history
…king-on-dfsn-win-server-19-p6

FISH-9186 : Use the LinkOption.NOFOLLOW_LINKS option
  • Loading branch information
luiseufrasio authored Aug 28, 2024
2 parents 885986e + eff82a6 commit d935913
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@

package org.apache.naming.resources;

import java.nio.file.LinkOption;
import java.text.MessageFormat;
import java.util.*;
import java.util.logging.Logger;
Expand Down Expand Up @@ -927,7 +928,7 @@ private File validate(File baseFile, String name, String keyName, Map<String, Fi
// Check that this file belongs to our root path
String canPath = null;
try {
canPath = normalize(file.toPath().toRealPath().toString());
canPath = normalize(file.toPath().toRealPath(LinkOption.NOFOLLOW_LINKS).toString());
} catch (IOException e) {
}
if (canPath == null || (!canPath.startsWith(canonicalBase) && !allowLinking)) {
Expand Down

0 comments on commit d935913

Please sign in to comment.