DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=34923>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=34923

           Summary: HostConfig fails for relative docBase containing ".."
           Product: Tomcat 5
           Version: Nightly Build
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: [EMAIL PROTECTED]


When configuring a context's docBase relative to the server's docBase using
"..", HostConfig org.apache.catalina.startup.HostConfig fails beause it thinks
the context's docBase is inside the server's. This is because HostConfig
compares the directory prefixes with getAbsolutePath, while it should use
getCanonicalPath

Example with catalina base="c:/tomcat", server docBase="webapps", context
docBase="../special"

getAbsolutePath now returns "c:/tomcat/webapps" for the server's docBase and
"c:/tomcat/webapps/../special" for the context's docBase. Since the prefixes are
the same, HostConfig thinks the context's docBase is inside of the server's.

getCanonicalPath returns "c:/tomcat/special" for the context's docBase, and
HostConfig works.


getCanonicalPath

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to