You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sebb (JIRA)" <ji...@apache.org> on 2008/03/09 21:21:46 UTC
[jira] Created: (NET-201) UnixFTPEntryParser does not handle
character/block special devices properly
UnixFTPEntryParser does not handle character/block special devices properly
---------------------------------------------------------------------------
Key: NET-201
URL: https://issues.apache.org/jira/browse/NET-201
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.
[jira] Updated: (NET-201) UnixFTPEntryParser does not handle
character/block special devices properly
Posted by "Martin Oberhuber (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/NET-201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Martin Oberhuber updated NET-201:
---------------------------------
Attachment: FTPParse_specialDevices.patch
Attached patch + unittests.
May I vote for this to be applied for the upcoming 1.5 release?
> UnixFTPEntryParser does not handle character/block special devices properly
> ---------------------------------------------------------------------------
>
> Key: NET-201
> URL: https://issues.apache.org/jira/browse/NET-201
> Project: Commons Net
> Issue Type: Bug
> Reporter: Sebb
> Attachments: FTPParse_specialDevices.patch
>
>
> 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.
[jira] Commented: (NET-201) UnixFTPEntryParser does not handle
character/block special devices properly
Posted by "Rory Winston (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/NET-201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579241#action_12579241 ]
Rory Winston commented on NET-201:
----------------------------------
Martin
That sounds reasonable to me - I'll apply to 1.5 and 2.0 now and then we can verify and test.
> UnixFTPEntryParser does not handle character/block special devices properly
> ---------------------------------------------------------------------------
>
> Key: NET-201
> URL: https://issues.apache.org/jira/browse/NET-201
> Project: Commons Net
> Issue Type: Bug
> Reporter: Sebb
> Attachments: FTPParse_specialDevices.patch
>
>
> 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.
[jira] Closed: (NET-201) UnixFTPEntryParser does not handle
character/block special devices properly
Posted by "Rory Winston (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/NET-201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rory Winston closed NET-201.
----------------------------
Resolution: Fixed
Fix Version/s: 2.0
1.5
Applied.
> UnixFTPEntryParser does not handle character/block special devices properly
> ---------------------------------------------------------------------------
>
> Key: NET-201
> URL: https://issues.apache.org/jira/browse/NET-201
> Project: Commons Net
> Issue Type: Bug
> Reporter: Sebb
> Fix For: 1.5, 2.0
>
> Attachments: FTPParse_specialDevices.patch
>
>
> 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.
[jira] Commented: (NET-201) UnixFTPEntryParser does not handle
character/block special devices properly
Posted by "Martin Oberhuber (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/NET-201?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12579189#action_12579189 ]
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 https://bugs.eclipse.org/bugs/show_bug.cgi?id=197105
A possible fix should be in UnixFTPEntryParser.java line 94, replace
+ "(\\d+)\\s+"
by
+ "(\\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 numbers.
> UnixFTPEntryParser does not handle character/block special devices properly
> ---------------------------------------------------------------------------
>
> Key: NET-201
> URL: https://issues.apache.org/jira/browse/NET-201
> 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.