Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-37259

Client uses LIST output rather than using MLSD command.

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Labels:
      None
    • Environment:
      Jenkins v2.17
      Publish-over-FTP v1.12
    • Similar Issues:

      Description

      The output of the LIST command is not defined, so parsing the output is error-prone.

      The MLSD (and MLST) commands are defined in RFC 3659, provides a "machine readable" directory listing, with a well-defined format. Conformant servers advertise that they support the command (via FEAT), allowing clients to use MLSD command if the server supports it. Apache commons ftp client also supports the mlsd command, albeit via explicit commands.

      The suggested improvement is that the publish-over-ftp uses MLSD command on servers that support it.

        Attachments

          Activity

          Hide
          slide_o_mix Alex Earl added a comment -

          It doesn't look like your server shows MLSD feature, only MLST. Should I look for the MLST feature or MLSD feature?

          Show
          slide_o_mix Alex Earl added a comment - It doesn't look like your server shows MLSD feature, only MLST. Should I look for the MLST feature or MLSD feature?
          Hide
          iepe1eet Paul Millar added a comment - - edited

          Have a look at RFC 3659 section 7.8:

          When responding to the FEAT command, a server-FTP process that
          supports MLST, and MLSD, plus internationalization of pathnames, MUST
          indicate that this support exists. It does this by including a MLST
          feature line.

          The MLST feature implies support for both the MLST and MLSD commands.

          The patch should also cares about whether or not the entry is a directory; i.e., the TYPE fact.  Theoretically, a server doesn't have to provide this information — a client should check the FEAT response to discover if it is enabled and use the OPT command to request the information, if available but not enabled.  I would imagine some of this the Apache code already does.

          Show
          iepe1eet Paul Millar added a comment - - edited Have a look at RFC 3659 section 7.8 : When responding to the FEAT command, a server-FTP process that supports MLST, and MLSD, plus internationalization of pathnames, MUST indicate that this support exists. It does this by including a MLST feature line. The MLST feature implies support for both the MLST and MLSD commands. The patch should also cares about whether or not the entry is a directory; i.e., the TYPE fact.  Theoretically, a server doesn't have to provide this information — a client should check the FEAT response to discover if it is enabled and use the OPT command to request the information, if available but not enabled.  I would imagine some of this the Apache code already does.
          Hide
          slide_o_mix Alex Earl added a comment -

          Thanks, I missed that part in the RFC. I am using ftpClient.hasFeature("MLST") and then using the ftpClient.mlistDir() method to iterate. 

          Show
          slide_o_mix Alex Earl added a comment - Thanks, I missed that part in the RFC. I am using ftpClient.hasFeature("MLST") and then using the ftpClient.mlistDir() method to iterate. 
          Hide
          iepe1eet Paul Millar added a comment -

          Incidentally, a throw-away comment in the FTPClient#listFiles([String)|http://download.oracle.com/javase/1.6.0/docs/api/java/lang/String.html?is-external=true] JavaDoc entry suggests the Apache Commons FTP client automatically chooses between LIST and MLSD.  If so, then perhaps that would be preferrable to testing.for MLST features explicitly.

          Show
          iepe1eet Paul Millar added a comment - Incidentally, a throw-away comment in the FTPClient# listFiles ([String)|http://download.oracle.com/javase/1.6.0/docs/api/java/lang/String.html?is-external=true] JavaDoc entry suggests the Apache Commons FTP client automatically chooses between LIST and MLSD.  If so, then perhaps that would be preferrable to testing.for MLST features explicitly.
          Hide
          slide_o_mix Alex Earl added a comment -

          Will be fixed in 1.13

          Show
          slide_o_mix Alex Earl added a comment - Will be fixed in 1.13

            People

            Assignee:
            slide_o_mix Alex Earl
            Reporter:
            iepe1eet Paul Millar
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: