Issue Details (XML | Word | Printable)

Key: NET-105
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Robert Lasch
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Net

[net] FTP Parsing off in Net Components for ACL

Created: 12/Mar/05 07:37 AM   Updated: 20/Sep/07 05:31 AM
Return to search
Component/s: None
Affects Version/s: Nightly Builds
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Operating System: Windows XP
Platform: PC

Bugzilla Id: 33972


 Description  « Hide
If a directory has a access control list tied to it, when a directory listing is
spit out, a plus is appended onto the end of the permissions. This causes
parsing of the file fails. Below are two patches that solves this. The first
is for the test file under
/net/trunk/src/test/org/apache/commons/net/ftp/parser/. The second is the
actual parser that is under /net/trunk/src/java/org/apache/commons/net/ftp/parser.

Index: UnixFTPEntryParserTest.java
===================================================================
— UnixFTPEntryParserTest.java (revision 155093)
+++ UnixFTPEntryParserTest.java (working copy)
@@ -24,7 +24,7 @@

/**

  • @author <a href="mailto:scohen@apache.org">Steve Cohen</a>
  • * @version $Id: UnixFTPEntryParserTest.java,v 1.15 2004/09/14 01:47:17 scohen
    Exp $
    + * @version $Id$
    */
    public class UnixFTPEntryParserTest extends FTPParseTestFramework
    {
    @@ -45,6 +45,7 @@

private static final String[] goodsamples =
{ + "-rw-r--r-- 1 500 500 21 Aug 8 14:14 JB3-TES1.gz", "-rwxr-xr-x 2 root root 4096 Mar 2 15:13 zxbox", "drwxr-xr-x 2 root root 4096 Aug 24 2001 zxjdbc", @@ -70,6 +71,8 @@ "-rwSr-Sr-- 1 500 500 0 Mar 25 08:22 testSuid", "-rwsr-sr-- 1 500 500 0 Mar 25 08:23 testSuidExec", "-rwsr-sr-- 1 500 500 0 Mar 25 0:23 testSuidExec2", + "drwxrwx---+ 23 500 500 0 Jan 10 13:09 testACL", + "-rw-r--r-- 1 1 3518644 May 25 12:12 std" };

Index: UnixFTPEntryParser.java
===================================================================
— UnixFTPEntryParser.java (revision 155093)
+++ UnixFTPEntryParser.java (working copy)
@@ -26,7 +26,7 @@

  • This class is based on the logic of Daniel Savarese's
  • DefaultFTPListParser, but adapted to use regular expressions and to fit the
  • new FTPFileEntryParser interface.
  • * @version $Id: UnixFTPEntryParser.java,v 1.21 2005/01/02 03:17:50 scohen Exp $
    + * @version $Id$
  • @see org.apache.commons.net.ftp.FTPFileEntryParser FTPFileEntryParser (for
    usage instructions)
    */
    public class UnixFTPEntryParser extends ConfigurableFTPFileEntryParserImpl
    @@ -65,7 +65,7 @@
    */
    private static final String REGEX =
    "([bcdlfmpSs-])"
  • +
    "(((r|)(w|)([xsStTL-]))((r|)(w|)([xsStTL-]))((r|)(w|)([xsStTL-])))
    s+"
    + +
    "(((r|)(w|)([xsStTL-]))((r|)(w|)([xsStTL-]))((r|)(w|)([xsStTL-])))\\+?
    s+"
    + "(\\d+)
    s+"
    + "(\\S+)
    s+"
    + "(?\\S+)
    s+)?"


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Rory Winston added a comment - 15/Apr/05 11:08 PM
Applied patch. Thanks.