FtpServer
  1. FtpServer
  2. FTPSERVER-326

LIST command does not work right with hidden files

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.0.2
    • Fix Version/s: 1.0.3, 1.1.0
    • Component/s: Core
    • Labels:
      None

      Description

      It appears that the LIST command does not work quite right with hidden files. My testing on a Windows system gave the following results:

      (1) a simple LIST command with no arguments, returns the list of all children (including hidden files)
      (2) LIST -la or LIST -a command returns all files that are NOT hidden

      I think the behavior should be the other way round; i.e. (1) should return all children that are not hidden and (2) should return all children including the hidden ones.

      1. FTPSERVER-326.patch
        0.7 kB
        Sai Pullabhotla

        Activity

        Hide
        Sai Pullabhotla added a comment -

        I was thinking of fixing this if you agree with me. Let me know.

        Thanks.

        Show
        Sai Pullabhotla added a comment - I was thinking of fixing this if you agree with me. Let me know. Thanks.
        Hide
        Niklas Gustavsson added a comment -

        It sounds like this i very much incorrect yes. Please fix for both 1.1.x and 1.0.x. Would be great if you can add a test case for this, but I expect that could be hard on Windows.

        Show
        Niklas Gustavsson added a comment - It sounds like this i very much incorrect yes. Please fix for both 1.1.x and 1.0.x. Would be great if you can add a test case for this, but I expect that could be hard on Windows.
        Hide
        Sai Pullabhotla added a comment -

        This is the fix for handling hidden files correctly. The fix is actually pretty simple. I could not create a test case for this as I do not have access to *NIX. However, I did some manual testing and things seem to be working as expected.

        I've a couple of questions/comments

        • This fix also affects the NLST command. NLST command now includes hidden files if and only if option "a" is present.
        • This fix also affects MLSD command, which always ignores hidden files. Previous versions were listing hidden files always. Do you think it is okay or should we change the MLSD to do what it was doing - list all files?
        • If we hide hidden files in MLSD, what should the "MLST hiddenfile" command do? Currently it still prints the attributes of the file.
        Show
        Sai Pullabhotla added a comment - This is the fix for handling hidden files correctly. The fix is actually pretty simple. I could not create a test case for this as I do not have access to *NIX. However, I did some manual testing and things seem to be working as expected. I've a couple of questions/comments This fix also affects the NLST command. NLST command now includes hidden files if and only if option "a" is present. This fix also affects MLSD command, which always ignores hidden files. Previous versions were listing hidden files always. Do you think it is okay or should we change the MLSD to do what it was doing - list all files? If we hide hidden files in MLSD, what should the "MLST hiddenfile" command do? Currently it still prints the attributes of the file.
        Hide
        Sai Pullabhotla added a comment -

        Any one has any comments on the MLS* command behavior with hidden files? The RFCs really does not say anything.

        Show
        Sai Pullabhotla added a comment - Any one has any comments on the MLS* command behavior with hidden files? The RFCs really does not say anything.
        Hide
        Niklas Gustavsson added a comment -

        Here's my opinion:

        For 1.0.x and 1.1.x: NLST should not show hidden files unless "a" is present
        For 1.1x: MLSD should ignore hidden files. MLST "hiddenfile" should show attributes.

        Show
        Niklas Gustavsson added a comment - Here's my opinion: For 1.0.x and 1.1.x: NLST should not show hidden files unless "a" is present For 1.1x: MLSD should ignore hidden files. MLST "hiddenfile" should show attributes.
        Hide
        Niklas Gustavsson added a comment -

        I'm thinking of getting 1.0.3 done and out. Would you have the time to get this fix in?

        Show
        Niklas Gustavsson added a comment - I'm thinking of getting 1.0.3 done and out. Would you have the time to get this fix in?
        Hide
        Sai Pullabhotla added a comment -

        I think the attached patch should do what you outlined. Would you be able to merge it into the appropriate branch(es). I just don't feel comfortable working with the branches yet. I do not want to mess up things accidentally.

        Show
        Sai Pullabhotla added a comment - I think the attached patch should do what you outlined. Would you be able to merge it into the appropriate branch(es). I just don't feel comfortable working with the branches yet. I do not want to mess up things accidentally.
        Hide
        Niklas Gustavsson added a comment -

        Sure, I'll take care of it

        Show
        Niklas Gustavsson added a comment - Sure, I'll take care of it
        Hide
        Niklas Gustavsson added a comment -

        Committed patch for both 1.0.x and 1.1.x in rev 818392. Great work!

        Show
        Niklas Gustavsson added a comment - Committed patch for both 1.0.x and 1.1.x in rev 818392. Great work!

          People

          • Assignee:
            Niklas Gustavsson
            Reporter:
            Sai Pullabhotla
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development