Uploaded image for project: 'Commons Net'
  1. Commons Net
  2. NET-265

UnixFTPEntryParser fails to parse entry in certain conditions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.2
    • None
    • None

    Description

      The UnixFTPEntryParser fails to parse following entry:
      rw-rr- 1 ftpuser ftpusers 12414535 Mar 17 11:07 test 1999 abc.pdf

      Because of the fact that the group name may contain spaces, it is extended in this case to "ftpusers 12414535 Mar".
      This happens because there is only one space between the group name an the file size (occurs (in my case) if the file size has eight or more digits). Additionally the file name contains spaces and the "second part" of the file name is a number. (Seems to be an odd case, but obviously it sometimes emerges.)

      The problem does not occur if a numeric date is used ("2008-03-19"). So I made the regex for the standard date ("Mar 19") more specific in a way that the month may only contain characters ([a-zA-Z]). Right now all non-whitespace characters are allowed (\S). The patch is attached.

      Attachments

        1. UnixParser.patch
          0.6 kB
          Thilo Ognibeni
        2. UnixParserTest.patch
          1.0 kB
          Thilo Ognibeni

        Activity

          People

            Unassigned Unassigned
            trivial.pursuit Thilo Ognibeni
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: