
| Key: |
NET-105
|
| Type: |
Bug
|
| Status: |
Closed
|
| Resolution: |
Fixed
|
| Priority: |
Major
|
| Assignee: |
Unassigned
|
| Reporter: |
Robert Lasch
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
Environment:
|
Operating System: Windows XP
Platform: PC
Operating System: Windows XP
Platform: PC
|
|
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+)?"
|
|
Description
|
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+)?"
|
Show » |
|