ASF Bugzilla – Attachment 29212 Details for
Bug 53531
ExpandWar.expand does not check the return value of File.mkdir and File.mkdirs
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
2012-08-11_tc55_53531.patch
2012-08-11_tc55_53531.patch (text/plain), 2.65 KB, created by
Konstantin Kolinko
on 2012-08-11 19:18:03 UTC
(
hide
)
Description:
2012-08-11_tc55_53531.patch
Filename:
MIME Type:
Creator:
Konstantin Kolinko
Created:
2012-08-11 19:18:03 UTC
Size:
2.65 KB
patch
obsolete
>Index: container/catalina/src/share/org/apache/catalina/startup/ContextConfig.java >=================================================================== >--- container/catalina/src/share/org/apache/catalina/startup/ContextConfig.java (revision 1371976) >+++ container/catalina/src/share/org/apache/catalina/startup/ContextConfig.java (working copy) >@@ -998,7 +998,7 @@ > try { > fixDocBase(); > } catch (IOException e) { >- log.error(sm.getString("contextConfig.fixDocBase"), e); >+ log.error(sm.getString("contextConfig.fixDocBase", context.getPath()), e); > } > > } >Index: container/catalina/src/share/org/apache/catalina/startup/ExpandWar.java >=================================================================== >--- container/catalina/src/share/org/apache/catalina/startup/ExpandWar.java (revision 1371976) >+++ container/catalina/src/share/org/apache/catalina/startup/ExpandWar.java (working copy) >@@ -132,7 +132,8 @@ > } > > // Create the new document base directory >- docBase.mkdir(); >+ if(!docBase.mkdir() && !docBase.isDirectory()) >+ throw new IOException(sm.getString("expandWar.createFailed", docBase)); > > // Expand the WAR into the new document base directory > String canonicalDocBasePrefix = docBase.getCanonicalPath(); >@@ -162,7 +163,8 @@ > if (last >= 0) { > File parent = new File(docBase, > name.substring(0, last)); >- parent.mkdirs(); >+ if(!parent.mkdirs() && !parent.isDirectory()) >+ throw new IOException(sm.getString("expandWar.createFailed", parent)); > } > if (name.endsWith("/")) { > continue; >Index: container/catalina/src/share/org/apache/catalina/startup/LocalStrings.properties >=================================================================== >--- container/catalina/src/share/org/apache/catalina/startup/LocalStrings.properties (revision 1371976) >+++ container/catalina/src/share/org/apache/catalina/startup/LocalStrings.properties (working copy) >@@ -57,6 +57,7 @@ > engineConfig.start=EngineConfig: Processing START > engineConfig.stop=EngineConfig: Processing STOP > expandWar.copy=Error copying {0} to {1} >+expandWar.createFailed=Unable to create the directory [{0}] > expandWar.deleteFailed=[{0}] could not be completely deleted. The presence of the remaining files may cause problems > expandWar.illegalPath=The archive [{0}] is malformed and will be ignored: an entry contains an illegal path [{1}] > hostConfig.appBase=Application base directory {0} does not exist
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 53531
:
29045
|
29050
| 29212