This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 7.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/7.0.x by this push:
     new 6ef2780  Partial fix for 
https://bz.apache.org/bugzilla/show_bug.cgi?id=63815
6ef2780 is described below

commit 6ef27808e499d5b84f9789e56dc0e846ef388005
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 f873a8f..b2ea3f8 100755
--- a/bin/catalina.sh
+++ b/bin/catalina.sh
@@ -339,6 +339,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"
@@ -380,7 +384,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 \
@@ -390,7 +394,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\"" \
@@ -448,7 +452,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 \
@@ -460,7 +464,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\"" \
@@ -513,7 +517,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\"" \
@@ -600,7 +604,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 35d3075..32f61c4 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 1b49259..fcef51b 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -72,7 +72,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

Reply via email to