Host host = (Host) context.getParent();
String appBase = host.getAppBase();
- boolean unpackWARs = true;
- if (host instanceof StandardHost) {
- unpackWARs = ((StandardHost) host).isUnpackWARs()
- && ((StandardContext) context).getUnpackWAR();
- }
-
File canonicalAppBase = new File(appBase);
if (canonicalAppBase.isAbsolute()) {
canonicalAppBase = canonicalAppBase.getCanonicalFile();
context.getWebappVersion());
String pathName = cn.getBaseName();
+ boolean unpackWARs = true;
+ if (host instanceof StandardHost) {
+ unpackWARs = ((StandardHost) host).isUnpackWARs() &&
+ ((StandardContext) context).getUnpackWAR() &&
+ (docBase.startsWith(canonicalAppBase.getPath()));
+ }
+
if (docBase.toLowerCase(Locale.ENGLISH).endsWith(".war") && !file.isDirectory() && unpackWARs) {
URL war = new URL("jar:" + (new File(docBase)).toURI().toURL() + "!/");
docBase = ExpandWar.expand(host, war, pathName);
inside server.xml and log a warning that the configuration has been
corrected. (markt)
</add>
+ <fix>
+ Don't unpack WAR files if they are not located in the Host's
+ appBase. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">