Bug 33095 - Symbolic links in webapp not working as expected
Summary: Symbolic links in webapp not working as expected
Status: RESOLVED INVALID
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.4
Hardware: Sun Solaris
: P3 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-14 11:19 UTC by Balbir Sanghera
Modified: 2005-05-03 08:06 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Balbir Sanghera 2005-01-14 11:19:35 UTC
When entering a directory that has symbolic links get the following exception
(with and without allowLinking enabled).  Can fix this by checking 
childCacheEntry.attributes for null, but the links are not followed when
clicked. Have tried this only on Solaris (sparc) and Linux (x86), get the same
results.


server.xml:
      <DefaultContext allowLinking="true"
                      caseSensitive="true"
                      crossContext="true"
                      reloadable="true"/>



SEVERE: Servlet.service() for servlet default threw exception
java.lang.NullPointerException
        at
org.apache.catalina.servlets.DefaultServlet.renderHtml(DefaultServlet.java:1324)
        at
org.apache.catalina.servlets.DefaultServlet.render(DefaultServlet.java:1081)
        at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java:786)
        at
org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java:323)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
        at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
        at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
        at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
        at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
        at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
        at
org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:365)
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
        at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:825)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:731)
        at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:526)
        at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
        at java.lang.Thread.run(Thread.java:595)
Comment 1 Torsten Fohrer 2005-01-14 13:34:44 UTC

See http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html

 DefaultContext in server.xml is no longer supported by tomcat.

cu Fohrer
Comment 2 Balbir Sanghera 2005-01-14 15:38:53 UTC
I have read the doc reference and have I've taken the DefaultContext out of the
server.xml and I still get the exception when I open a directory containing a
symbolic link.



Comment 3 Remy Maucherat 2005-01-14 15:41:13 UTC
BZ is not a support list.
Comment 4 Balbir Sanghera 2005-01-14 15:59:17 UTC
Ok then,  why should a symbolic link in a directory cause the container to throw
exception??, that's why I raised a bug.

The web app directory is:

ROOT/
    | filea
    | fileb
    | tmp1/
         | filef -> ../filea
    | 
    | tmp2/
         | dirc -> /opt/test/somedir


1.  While I open the browser at "/" I get a directory listing
2.  When I move the browser into tmp or tmp2 I get an exception (weather
I have allowLinking enabled/disabled)

bal.




       
Comment 5 Guy McArthur 2005-03-01 01:32:47 UTC
Verified this on Tomcat 5.5.7. Directory listing fails when a symbolic link is
present.
Comment 6 Yoav Shapira 2005-03-23 17:43:13 UTC
Guy, are you getting the same exception stack trace, namely an NPE in line 1324
of DefaultServlet, on 5.5.7?  Looking at the source code for DefaultServlet,
that line is sb.append where sb.append had been called a few times before in
that method, so an NPE there doesn't seem possible.
Comment 7 Yoav Shapira 2005-05-03 16:06:48 UTC
Please do not reopen an issue without providing further comment or data.