[ https://issues.apache.org/jira/browse/SSHD-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15945068#comment-15945068 ]
Marcin Kozakiewicz commented on SSHD-733: ----------------------------------------- [~ppraszmo] after applying these changes server works as expected: {code} diff --git a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java index 120f0c0..1e70f13 100644 --- a/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java +++ b/sshd-core/src/main/java/org/apache/sshd/server/subsystem/sftp/SftpSubsystem.java @@ -1804,7 +1804,7 @@ public class SftpSubsystem } Path file = dh.getFile(); - LinkOption[] options = IoUtils.getLinkOptions(false); + LinkOption[] options = IoUtils.getLinkOptions(true); Boolean status = IoUtils.checkFileExists(file, options); if (status == null) { throw new AccessDeniedException("Cannot determine existence of read-dir for " + file); @@ -1862,7 +1862,7 @@ public class SftpSubsystem String handle; try { - handle = doOpenDir(id, path, IoUtils.getLinkOptions(false)); + handle = doOpenDir(id, path, IoUtils.getLinkOptions(true)); } catch (IOException | RuntimeException e) { sendStatus(BufferUtils.clear(buffer), id, e); return; {code} > SSHD server displays file symlinks instead of dir symlinks > ---------------------------------------------------------- > > Key: SSHD-733 > URL: https://issues.apache.org/jira/browse/SSHD-733 > Project: MINA SSHD > Issue Type: Wish > Affects Versions: 1.2.0 > Environment: Windows/Linux > Reporter: Marcin Kozakiewicz > Priority: Minor > > We use sshd for junit testing of sftp file transfers. > Scenario: > 1.create filesystem: > {code} > ├── mem0 > │ └── mem0.txt > ├── run -> mem0 > └── run2 -> mem0 > {code} > 2. Start SSh server with given file system. > code snippet from out project: > {code} > _server = SshServer.setUpDefaultServer(); > _server.setHost("localhost"); > _server.setPort(PORT); > _server.setKeyPairProvider(new SimpleGeneratorHostKeyProvider()); > _server.setPasswordAuthenticator(new PasswordAuthenticator() { > @Override > public boolean authenticate(final String username, final String > password, final ServerSession session) { > return USERNAME.equals(username) && PASSWORD.equals(password); > } > }); > _server.setSubsystemFactories(singletonList(new > SftpSubsystemFactory())); > _server.setFileSystemFactory(new > VirtualFileSystemFactory(fileSystemPath)); > _server.start(); > {code} > 3. Connect to server with sftp client. > Result: > run and run2 symlinks are presented as file symlinks instead of directory > symlinks. > Expected result: > run and run2 are presented as directory symlinks. -- This message was sent by Atlassian JIRA (v6.3.15#6346)