MINA SSHD
  1. MINA SSHD
  2. SSHD-98

Directories in sftp should have executable permission set

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.5.0
    • Fix Version/s: 0.6.0
    • Labels:
      None

      Description

      When accessing directories via sftp, the executable bit should be set (for compatibility with linux).

      Without it, this causes problems when I use sshfs (a fuse based file system on Linux) to mount the sftp directory as a filesystem. I can't cd into the directories.

      See attached patch.

      1. executable patch.txt
        2 kB
        Will Glass-Husain

        Activity

        Hide
        Will Glass-Husain added a comment - - edited

        I'm afraid I couldn't figure out how to create a test to check this with jsch. However, all existing tests pass, and I manually checked this with winscp. (directories have executable set and other files don't.)

        Show
        Will Glass-Husain added a comment - - edited I'm afraid I couldn't figure out how to create a test to check this with jsch. However, all existing tests pass, and I manually checked this with winscp. (directories have executable set and other files don't.)
        Hide
        Guillaume Nodet added a comment -

        Committing to https://svn.apache.org/repos/asf/mina/sshd/trunk ...
        M sshd-core/src/main/java/org/apache/sshd/server/SshFile.java
        M sshd-core/src/main/java/org/apache/sshd/server/filesystem/NativeSshFile.java
        M sshd-core/src/main/java/org/apache/sshd/server/sftp/SftpSubsystem.java
        Committed r1039520

        The patch is slightly different from yours and try to leverage the canExecute method which has been introduced in JDK 1.6 (and default to isDirectory() if not available). Could you please double check that it works for you ?

        Show
        Guillaume Nodet added a comment - Committing to https://svn.apache.org/repos/asf/mina/sshd/trunk ... M sshd-core/src/main/java/org/apache/sshd/server/SshFile.java M sshd-core/src/main/java/org/apache/sshd/server/filesystem/NativeSshFile.java M sshd-core/src/main/java/org/apache/sshd/server/sftp/SftpSubsystem.java Committed r1039520 The patch is slightly different from yours and try to leverage the canExecute method which has been introduced in JDK 1.6 (and default to isDirectory() if not available). Could you please double check that it works for you ?

          People

          • Assignee:
            Guillaume Nodet
            Reporter:
            Will Glass-Husain
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development