Author: markt Date: Thu Oct 10 09:17:24 2013 New Revision: 1530890 URL: http://svn.apache.org/r1530890 Log: Partial fix for https://issues.apache.org/bugzilla/show_bug.cgi?id=55620 Prevent Tomcat from starting on Windows when CATALINA_HOME contains a ; character
Modified: tomcat/trunk/bin/catalina.bat Modified: tomcat/trunk/bin/catalina.bat URL: http://svn.apache.org/viewvc/tomcat/trunk/bin/catalina.bat?rev=1530890&r1=1530889&r2=1530890&view=diff ============================================================================== --- tomcat/trunk/bin/catalina.bat (original) +++ tomcat/trunk/bin/catalina.bat Thu Oct 10 09:17:24 2013 @@ -132,6 +132,23 @@ if not "%CATALINA_BASE%" == "" goto gotB set "CATALINA_BASE=%CATALINA_HOME%" :gotBase +rem Ensure that neither CATALINA_HOME nor CATALINA_BASE contains a semi-colon +rem as this is used as the separator in the classpath and Java provides no +rem mechanism for escaping if the same character appears in the path. Check this +rem by replacing all occurrences of ';' with '' and checking that neither +rem CATALINA_HOME nor CATALINA_BASE have changed +if "%CATALINA_HOME%" == "%CATALINA_HOME:;=%" goto homeNoSemicolon +echo Using CATALINA_HOME: "%CATALINA_HOME%" +echo Unable to start as CATALINA_HOME contains a semicolon (;) character +goto end +:homeNoSemicolon + +if "%CATALINA_BASE%" == "%CATALINA_BASE:;=%" goto baseNoSemicolon +echo Using CATALINA_BASE: "%CATALINA_BASE%" +echo Unable to start as CATALINA_HOME contains a semicolon (;) character +goto end +:baseNoSemicolon + rem Ensure that any user defined CLASSPATH variables are not used on startup, rem but allow them to be specified in setenv.bat, in rare case when it is needed. set CLASSPATH= --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org