Commons Net
  1. Commons Net
  2. NET-480

Wrong passivHost when using FTPHTTPClient with EPSV

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1, 3.2
    • Fix Version/s: 3.3
    • Component/s: FTP
    • Labels:
      None
    • Environment:

      All Systems with ftp Access over http

      Description

      At the FTPHTTPClient Class in line 99 the Answer from the EPSV Command will parse to receive the Data port and the passiv Host.
      _parsePassiveModeReply(_replyLines.get(0))
      In this function the __passivHost is set to the remoteAddress, but this address is determine by "this._socket_.getInetAddress();" and the socket is the socket of the proxy Server and NOT of the ftp Server.

        Activity

        Hide
        Sebb added a comment -

        Are you referring to the condition in the _parsePassiveModeReply() method where the response is overwritten if the parsed reply is a siteLocalAddress but the target address is not? i.e. where a NAT box has changed the PASV reply?

        Have you got a (tested) patch you can provide?

        Show
        Sebb added a comment - Are you referring to the condition in the _parsePassiveModeReply() method where the response is overwritten if the parsed reply is a siteLocalAddress but the target address is not? i.e. where a NAT box has changed the PASV reply? Have you got a (tested) patch you can provide?
        Hide
        Peter Naber added a comment -

        Oh sorry, it's my mistake.
        I mean the methode _parseExtendedPassiveModeReply() (EPSV not PASV).
        No, I haven't a patch for it, only a dirty workaround for me
        I will look today, if I found a clean solution for it.

        Show
        Peter Naber added a comment - Oh sorry, it's my mistake. I mean the methode _parseExtendedPassiveModeReply() (EPSV not PASV). No, I haven't a patch for it, only a dirty workaround for me I will look today, if I found a clean solution for it.
        Hide
        Sebb added a comment -

        Can you attach a copy of the work-round?
        That would at least show what works for you.

        Show
        Sebb added a comment - Can you attach a copy of the work-round? That would at least show what works for you.
        Hide
        Peter Naber added a comment - - edited

        Own testet SquidProxy Class with working EPSV Protocol.
        A new class variable is add : host
        This variable contain the original destination Address.
        At openDataConnection the variable __passivHost will set to the destination address.
        By using PASV the variable is set to "this.getPassiveHost()", by using EPSV to this.host

        Show
        Peter Naber added a comment - - edited Own testet SquidProxy Class with working EPSV Protocol. A new class variable is add : host This variable contain the original destination Address. At openDataConnection the variable __passivHost will set to the destination address. By using PASV the variable is set to "this.getPassiveHost()", by using EPSV to this.host
        Hide
        Sebb added a comment -

        Finally got around to looking at this again.
        It looks like the work-round you used is necessary, so committed it:

        URL: http://svn.apache.org/viewvc?rev=1437243&view=rev
        Log:
        NET-480 Wrong passivHost when using FTPHTTPClient with EPSV

        Modified:
        commons/proper/net/trunk/src/changes/changes.xml
        commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java

        Show
        Sebb added a comment - Finally got around to looking at this again. It looks like the work-round you used is necessary, so committed it: URL: http://svn.apache.org/viewvc?rev=1437243&view=rev Log: NET-480 Wrong passivHost when using FTPHTTPClient with EPSV Modified: commons/proper/net/trunk/src/changes/changes.xml commons/proper/net/trunk/src/main/java/org/apache/commons/net/ftp/FTPHTTPClient.java

          People

          • Assignee:
            Unassigned
            Reporter:
            Peter Naber
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development