[ 
https://issues.apache.org/jira/browse/SSHD-733?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15941638#comment-15941638
 ] 

Goldstein Lyor commented on SSHD-733:
-------------------------------------

The code can be easly debugged by looking at {{SftpSubsystem#doOpenDir}}:
{code:java}
protected String doOpenDir(int id, String path, LinkOption... options) throws 
IOException {
        Path p = resolveNormalizedLocation(path);
        if (log.isDebugEnabled()) {
            log.debug("doOpenDir({})[id={}] SSH_FXP_OPENDIR (path={})[{}]",
                      getServerSession(), id, path, p);
        }

        Boolean status = IoUtils.checkFileExists(p, options);
        if (status == null) {
            throw new AccessDeniedException("Cannot determine open-dir 
existence for " + p);
        }

        if (!status) {
            throw new FileNotFoundException(path);
        } else if (!Files.isDirectory(p, options)) {
            throw new NotDirectoryException(path);
        } else if (!Files.isReadable(p)) {
            throw new AccessDeniedException("Not readable: " + p);
        } else {
            String handle = generateFileHandle(p);
            DirectoryHandle dirHandle = new DirectoryHandle(this, p, handle);
            handles.put(handle, dirHandle);
            return handle;
        }
    }
{code}
Seems that {{Files.isDirectory(p, options}} returns {{false}}, so I don't see 
what else SSHD can do...

> 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)

Reply via email to