This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new 752f17b Partial fix for https://bz.apache.org/bugzilla/show_bug.cgi?id=63815 752f17b is described below commit 752f17b3dec8746d4828fc576577eac03ec4fa5c Author: Mark Thomas <ma...@apache.org> AuthorDate: Tue Nov 26 15:50:05 2019 +0000 Partial fix for https://bz.apache.org/bugzilla/show_bug.cgi?id=63815 This addresses catalina.sh (apart from -debug see comment in script), daemon.sh and the scripts that depend on tool-wrapper.sh We need a fix for the JRE bug before we can implement a complete fix. --- bin/catalina.sh | 16 ++++++----- bin/daemon.sh | 66 ++++++++++++++++++++++++---------------------- bin/tool-wrapper.sh | 8 +++--- webapps/docs/changelog.xml | 2 +- 4 files changed, 49 insertions(+), 43 deletions(-) diff --git a/bin/catalina.sh b/bin/catalina.sh index 5fbdb72..2fabcd1 100755 --- a/bin/catalina.sh +++ b/bin/catalina.sh @@ -343,6 +343,10 @@ if [ "$1" = "jpda" ] ; then shift fi +# TODO: Bugzilla 63815 +# This doesn't currently work (and can't be made to work) if values used in +# CATALINA_OPTS and/or JAVA_OPTS require quoting. See: +# https://bugs.openjdk.java.net/browse/JDK-8234808 if [ "$1" = "debug" ] ; then if $os400; then echo "Debug command not available on OS400" @@ -384,7 +388,7 @@ elif [ "$1" = "run" ]; then echo "Using Security Manager" fi shift - eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \ + eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Djava.security.manager \ @@ -394,7 +398,7 @@ elif [ "$1" = "run" ]; then -Djava.io.tmpdir="\"$CATALINA_TMPDIR\"" \ org.apache.catalina.startup.Bootstrap "$@" start else - eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \ + eval exec "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ @@ -452,7 +456,7 @@ elif [ "$1" = "start" ] ; then echo "Using Security Manager" fi shift - eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \ + eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Djava.security.manager \ @@ -464,7 +468,7 @@ elif [ "$1" = "start" ] ; then >> "$CATALINA_OUT" 2>&1 "&" else - eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVA_OPTS $CATALINA_OPTS \ + eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER "$JAVA_OPTS" "$CATALINA_OPTS" \ -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ @@ -517,7 +521,7 @@ elif [ "$1" = "stop" ] ; then fi fi - eval "\"$_RUNJAVA\"" $LOGGING_MANAGER $JAVA_OPTS \ + eval "\"$_RUNJAVA\"" $LOGGING_MANAGER "$JAVA_OPTS" \ -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ @@ -604,7 +608,7 @@ elif [ "$1" = "stop" ] ; then elif [ "$1" = "configtest" ] ; then - eval "\"$_RUNJAVA\"" $LOGGING_MANAGER $JAVA_OPTS \ + eval "\"$_RUNJAVA\"" $LOGGING_MANAGER "$JAVA_OPTS" \ -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ -classpath "\"$CLASSPATH\"" \ -Dcatalina.base="\"$CATALINA_BASE\"" \ diff --git a/bin/daemon.sh b/bin/daemon.sh index afa4c89..288f58b 100755 --- a/bin/daemon.sh +++ b/bin/daemon.sh @@ -199,49 +199,51 @@ fi case "$1" in run ) shift - "$JSVC" $* \ - $JSVC_OPTS \ - -java-home "$JAVA_HOME" \ - -pidfile "$CATALINA_PID" \ - -wait "$SERVICE_START_WAIT_TIME" \ + eval exec "\"$JSVC\"" $* \ + "$JSVC_OPTS" \ + -java-home "\"$JAVA_HOME\"" \ + -pidfile "\"$CATALINA_PID\"" \ + -wait $SERVICE_START_WAIT_TIME \ -nodetach \ - -outfile "&1" \ - -errfile "&2" \ - -classpath "$CLASSPATH" \ - "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \ - -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMP" \ + -outfile "\"&1\"" \ + -errfile "\"&2\"" \ + -classpath "\"$CLASSPATH\"" \ + "\"$LOGGING_CONFIG\"" "$JAVA_OPTS" "$CATALINA_OPTS" \ + -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ + -Dcatalina.base="\"$CATALINA_BASE\"" \ + -Dcatalina.home="\"$CATALINA_HOME\"" \ + -Djava.io.tmpdir="\"$CATALINA_TMP\"" \ $CATALINA_MAIN exit $? ;; start ) - "$JSVC" $JSVC_OPTS \ - -java-home "$JAVA_HOME" \ + eval "\"$JSVC\"" \ + "$JSVC_OPTS" \ + -java-home "\"$JAVA_HOME\"" \ -user $TOMCAT_USER \ - -pidfile "$CATALINA_PID" \ - -wait "$SERVICE_START_WAIT_TIME" \ - -outfile "$CATALINA_OUT" \ - -errfile "&1" \ - -classpath "$CLASSPATH" \ - "$LOGGING_CONFIG" $JAVA_OPTS $CATALINA_OPTS \ - -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMP" \ + -pidfile "\"$CATALINA_PID\"" \ + -wait $SERVICE_START_WAIT_TIME \ + -outfile "\"$CATALINA_OUT\"" \ + -errfile "\"&1\"" \ + -classpath "\"$CLASSPATH\"" \ + "\"$LOGGING_CONFIG\"" "$JAVA_OPTS" "$CATALINA_OPTS" \ + -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ + -Dcatalina.base="\"$CATALINA_BASE"\" \ + -Dcatalina.home="\"$CATALINA_HOME\"" \ + -Djava.io.tmpdir="\"$CATALINA_TMP\"" \ $CATALINA_MAIN exit $? ;; stop ) - "$JSVC" $JSVC_OPTS \ + eval "\"$JSVC\"" \ + "$JSVC_OPTS" \ -stop \ - -pidfile "$CATALINA_PID" \ - -classpath "$CLASSPATH" \ - -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \ - -Dcatalina.base="$CATALINA_BASE" \ - -Dcatalina.home="$CATALINA_HOME" \ - -Djava.io.tmpdir="$CATALINA_TMP" \ + -pidfile "\"$CATALINA_PID\"" \ + -classpath "\"$CLASSPATH\"" \ + -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ + -Dcatalina.base="\"$CATALINA_BASE\"" \ + -Dcatalina.home="\"$CATALINA_HOME\"" \ + -Djava.io.tmpdir="\"$CATALINA_TMP\"" \ $CATALINA_MAIN exit $? ;; diff --git a/bin/tool-wrapper.sh b/bin/tool-wrapper.sh index f9924da..863ca49 100755 --- a/bin/tool-wrapper.sh +++ b/bin/tool-wrapper.sh @@ -146,8 +146,8 @@ JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLog # ----- Execute The Requested Command ----------------------------------------- -exec "$_RUNJAVA" $JAVA_OPTS $TOOL_OPTS \ - -D$ENDORSED_PROP="$JAVA_ENDORSED_DIRS" \ - -classpath "$CLASSPATH" \ - -Dcatalina.home="$CATALINA_HOME" \ +eval exec "\"$_RUNJAVA\"" "$JAVA_OPTS" "$TOOL_OPTS" \ + -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \ + -classpath "\"$CLASSPATH\"" \ + -Dcatalina.home="\"$CATALINA_HOME\"" \ org.apache.catalina.startup.Tool "$@" diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index cbed682..57c30ac 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -85,7 +85,7 @@ <subsection name="Other"> <changelog> <fix> - Revert the fix for <bug>63815</bug> (quoting the use of + Correct the fix for <bug>63815</bug> (quoting the use of <code>CATALINA_OPTS</code> and <code>JAVA_OPTS</code> when used in shell scripts to avoid the expansion of <code>*</code>) as it caused various regressions, particularly with <code>daemon.sh</code>. (markt) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org