You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by "Magesh Arul (JIRA)" <ji...@apache.org> on 2014/10/28 13:45:33 UTC

[jira] [Created] (SSHD-367) File Listing fails for SFTP Protocol version 4 and 5 when using org.apache.sshd.sftp.subsystem.SftpSubsystem

Magesh Arul created SSHD-367:
--------------------------------

             Summary: File Listing fails for SFTP Protocol version 4 and 5 when using org.apache.sshd.sftp.subsystem.SftpSubsystem
                 Key: SSHD-367
                 URL: https://issues.apache.org/jira/browse/SSHD-367
             Project: MINA SSHD
          Issue Type: Bug
    Affects Versions: 0.11.0
            Reporter: Magesh Arul


File listing with org.apache.sshd.sftp.subsystem.SftpSubsystem fails in WinSCP client as it uses SFTP protocol version 5 by default. 

This is also mentioned in issue
https://issues.apache.org/jira/browse/SSHD-325

This could however be avoided by forcing WinSCP to use SFTP Protocol version 3.

Cause of the issue :
The problem here is in sending of the fIle atrributes back to the client.
In org.apache.sshd.sftp.subsystem.SftpSubsystem, line 668
Method sendName uses,

int flags = SSH_FILEXFER_ATTR_PERMISSIONS | SSH_FILEXFER_ATTR_SIZE | SSH_FILEXFER_ATTR_ACCESSTIME;

Whereas in org.apache.sshd.sftp.subsystem.Serializer.writeAttrs() Access time attribute is not added to the buffer. 

This causes a decode issue on the client side.

Fix :
Remove flag SSH_FILEXFER_ATTR_ACCESSTIME as we are not writing it back to the client.

In org.apache.sshd.sftp.subsystem.SftpSubsystem.sendName()
line 668

Change to 
int flags = SSH_FILEXFER_ATTR_PERMISSIONS | SSH_FILEXFER_ATTR_SIZE;




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)