commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Oberhuber (JIRA)" <>
Subject [jira] Commented: (NET-201) UnixFTPEntryParser does not handle character/block special devices properly
Date Sun, 16 Mar 2008 13:22:24 GMT


Martin Oberhuber commented on NET-201:

We found the same issue on a Solaris server a while back, and resorted to a workaround of
not showing the file (because we reckoned that users cannot do much with a character special
device anyways).

The point is that Commons Net throws a parse exception, because it expects a single number
("size") where it finds the device numbers ("0, 27"). What we did is catch the exception and
ignore the file. See

A possible fix should be in line 94, replace
        + "(\\d+)\\s+"  
        + "(\\d+(?:,\\s*\\d+)?)\\s+"

This will result in a valid FTPFile with size=0 and valid raw listing attached. I do not think
that it is worth changing the FTPFile API to have separate fields for the major and minor

> UnixFTPEntryParser does not handle character/block special devices properly
> ---------------------------------------------------------------------------
>                 Key: NET-201
>                 URL:
>             Project: Commons Net
>          Issue Type: Bug
>            Reporter: Sebb
> The following is a valid entry from a FreeBSD system:
>       crw-r-----  1 root      kmem        0,  27 Jan 30 11:42 kmem
> This causes a parse error, because the regular expression does not allow for the major
and minor device numbers.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message