Only perform validation test when allowLinking is enabled
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 Feb 2009 20:00:01 +0000 (20:00 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Mon, 9 Feb 2009 20:00:01 +0000 (20:00 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@742711 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/naming/resources/FileDirContext.java

index 1bdd9db..981c890 100644 (file)
@@ -846,7 +846,7 @@ public class FileDirContext extends BaseDirContext {
      * List the resources which are members of a collection.
      *
      * @param file Collection
-     * @return Vector containg NamingEntry objects
+     * @return Vector containing NamingEntry objects
      */
     protected ArrayList<NamingEntry> list(File file) {
 
@@ -867,8 +867,11 @@ public class FileDirContext extends BaseDirContext {
 
         for (int i = 0; i < names.length; i++) {
 
-            File currentFile = validate(new File(file, names[i]));
-            if (currentFile == null) continue;
+            File currentFile = new File(file, names[i]);
+            if (allowLinking) {
+                currentFile = validate(currentFile);
+                if (currentFile == null) continue;
+            }
             
             Object object = null;
             if (currentFile.isDirectory()) {