Commons Net
  1. Commons Net
  2. NET-502

Apache FTPClient doesn't handle common responses to PWD

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Duplicate
    • Affects Version/s: 3.2
    • Fix Version/s: 3.3
    • Component/s: FTP
    • Labels:
      None

      Description

      Common FTP servers (like vsftpd) responses' to PWD don't have a commentary as per RFC959.

      vsftpd, MockFtpServer and others respond thusly:

      > 257 "/"

      The current handling in FTPClient.__parsePathname simply returns everything after "257 ". This breaks other code that relies on Apache FTPClient, like the Camel FTP2 component.

      I suggest that, for increased resilience, this brief response be special-cased.

      vsftpd maintainer has been notified too, but it's just an email address.

        Issue Links

          Activity

          Hide
          Carsten Erker added a comment -

          Barry is right, in
          end = lastIndexOf("\" "),
          there was a space after the double quote, so for a valid response like '257 "/"', the result was '"/"' instead of '/'.

          I stumbled upon this using the current Camel version 2.11.0.

          Show
          Carsten Erker added a comment - Barry is right, in end = lastIndexOf("\" "), there was a space after the double quote, so for a valid response like '257 "/"', the result was '"/"' instead of '/'. I stumbled upon this using the current Camel version 2.11.0.
          Hide
          Barry Kelly added a comment -

          Hmmm; it looks like http://svn.apache.org/r1420655 fixed it, NET-492 rather than NET-442.

          Show
          Barry Kelly added a comment - Hmmm; it looks like http://svn.apache.org/r1420655 fixed it, NET-492 rather than NET-442 .
          Hide
          Sebb added a comment -

          As far as I can tell, this was fixed as part of NET-442, which is included in NET 3.2.

          There does not seem to be a problem with the current code, see:

          URL: http://svn.apache.org/r1444907
          Log:
          Add test for NET-502

          Modified:
          commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientTest.java

          Please provide a test case that shows the problem.
          For example, as a patch for FTPClientTest.java.

          Show
          Sebb added a comment - As far as I can tell, this was fixed as part of NET-442 , which is included in NET 3.2. There does not seem to be a problem with the current code, see: URL: http://svn.apache.org/r1444907 Log: Add test for NET-502 Modified: commons/proper/net/trunk/src/test/java/org/apache/commons/net/ftp/FTPClientTest.java Please provide a test case that shows the problem. For example, as a patch for FTPClientTest.java.

            People

            • Assignee:
              Unassigned
              Reporter:
              Barry Kelly
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development