Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4448755

FtpClient fails to login to a server that returns a certain [longer] greeting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.3.0
    • core-libs
    • beta2
    • generic
    • generic



      Name: krC82822 Date: 04/20/2001


      java version "1.3.0"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
      Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)

      FtpClient.login threw a StringIndexOutOfBoundsException whenever we tried to
      login to a particular server. The server was sending a multi-line response of
      the form:

                  230-1st line
                  other lines
                  230 last line

      (as permitted by RFC959) and one of the "other lines" had **exactly 3**
      characters.

      An FTP client is supposed to read lines up to a line which contains a space
      after the 230 code. Although the underlying
      TransferProtocolClient.readServerResponse will read all the lines in,
      FtpClient.login will only look at those lines up to a line which doesn't begin
      with "230-", which isn't the same thing! This causes 3 problems:

      (1) FtpClient.login will not store all of the lines into the welcomeMsg.

      (2) It would be useful if FtpClient.login inserting '\n' between lines
      concatenated into welcomeMsg.

      (3) **The real problem** A 3-character line will result in an exception when it
      attempts to compare the 4th character with "-".
      (Review ID: 121110)
      ======================================================================

            jccollet Jean-Christophe Collet (Inactive)
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: