2 Replies Latest reply on Nov 9, 2010 10:52 AM by Oliver Hörmann

    Problem with FTP Gateway

    Bernard Tison Newbie


      I think there might be a problem with the way user/password information is parsed from the FTP URL for a FTP Gateway.
      This is based on the static router quickstart example.

      The jbossesb.xml contains the following provider definition:

      <ftp-provider name="FTPprovider" hostname="localhost" >
       <ftp-bus busid="StaticRouterFtpGW" >

      This results in the following definition in the jbossesb-gateway.xml:
      <Ftp-Gateway URL="ftp://ftpuser:ftppassword@localhost:/tmp/esbInput"
       errorDelete="true" gatewayClass="org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener"
       ...(non-relevant portion removed) "/>

      When the gateway is initialized, the org.jboss.internal.soa.esb.util.EdtFtpImpl class will parse the URL and connect to the FTP server.
      To parse the username/password out of the URL, the checkParms() method of the EdtFtpImpl class uses the following code (lines 190-198):
       String[] sa = (null == url) ? null
       : url.getAuthority().split(":");
       m_sUser = (null!=sa) ? sa[0] :m_oParms.getAttribute(PARMS_USER);
       if (null == m_sUser)
       throw new Exception("No username specified for FTP");
       m_sPasswd = (null!=sa) ? sa[1] :m_oParms.getAttribute(PARMS_PASSWD);

      The url.getAuthority() method returns ftpuser:ftppassword@localhost, which results in m_sUser="ftpuser" and m_sPasswd="ftppassword@localhost". This should be: m_sUser="ftpuser" and m_sPasswd="ftppassword".

      Suggestion for fix: use url.getUserInfo() to get the user/password out of the FTP URL. This is how it is done in the EdtFtpImpl(FTPEpr p_oP, boolean p_bConnect) constructor.


        • 1. Re: Problem with FTP Gateway
          Mark Little Master

          Thanks Bernard. If you have JIRA access can you create a bug and assign this to Esteban? If not, let me know and I'll do it.

          • 2. Re: Problem with FTP Gateway
            Oliver Hörmann Newbie



            I've got a similar problem:

            If the password of the ftp account which is to be polled by the FTP Gateway contains a colon ":", the gateway won't come up. Instead it throws an error that the username is unknown. As soon as I change the password, the error is gone. However, telling my customers to change their passwords to circumvent this behaviour would be my last resort.


            I suppose it is because username and password are sorted out via the split method. Is that a bug?





            P.S.: No, I don't have JIRA access.