lgoldstein commented on a change in pull request #207: URL: https://github.com/apache/mina-sshd/pull/207#discussion_r739665726
########## File path: sshd-common/src/main/java/org/apache/sshd/common/util/io/IoUtils.java ########## @@ -372,11 +374,23 @@ public static String getFileOwner(Path path, LinkOption... options) throws IOExc * explained above */ public static Boolean checkFileExists(Path path, LinkOption... options) { - if (Files.exists(path, options)) { + boolean followLinks = true; + for (LinkOption opt : options) { + if (opt == LinkOption.NOFOLLOW_LINKS) { + followLinks = false; + break; + } + } + try { + if (followLinks) { + path.getFileSystem().provider().checkAccess(path); + } else { + Files.readAttributes(path, BasicFileAttributes.class, LinkOption.NOFOLLOW_LINKS); + } return Boolean.TRUE; - } else if (Files.notExists(path, options)) { + } catch (NoSuchFileException e) { Review comment: I trust your judgement on this -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org