https://bz.apache.org/bugzilla/show_bug.cgi?id=62329

            Bug ID: 62329
           Summary: AbstractArchiveResourceSet#listWebAppPaths does not
                    list directories if the zip central directory doesn't
                    have them
           Product: Tomcat 9
           Version: 9.0.7
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
          Assignee: dev@tomcat.apache.org
          Reporter: meelis.m...@gmail.com
  Target Milestone: -----

Consider a jar containing

META-INF/resources/foo/bar.txt
META-INF/resources/foo/baz.txt
META-INF/resources/baz.txt

The following are two examples of valid zip central directory listings for the
above jar

A:
META-INF/
META-INF/resources/
META-INF/resources/foo/
META-INF/resources/foo/bar.txt
META-INF/resources/foo/baz.txt
META-INF/resources/baz.txt

B:
META-INF/resources/
META-INF/resources/foo/bar.txt
META-INF/resources/foo/baz.txt
META-INF/resources/baz.txt

In A case AbstractArchiveResourceSet#listWebAppPaths("/") will return ["/foo/",
"/baz.txt"]
In B case AbstractArchiveResourceSet#listWebAppPaths("/") will return
["/baz.txt"]

Considering the JavaDoc for WebResourceSet#listWebAppPaths states:
Obtain the Set of the web applications pathnames of *all* of the files and
*directories* located in the specified directory.

This means the implementation is faulty in the B case.

This bug caused an issue in JRebel when the following artifact was present:
https://mvnrepository.com/artifact/org.webjars.bowergithub.vaadin/vaadin-button/2.0.0-beta3
Resulting in the lookup for "/webjars/vaadin-button/src/vaadin-button.html" to
fail, as the central directory entry
"/META-INF/resources/webjars/vaadin-button/src/" was missing and code
eventually relied on listWebAppPaths to return the folder "src".

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to