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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 6b15b94  BZ 64270. Use documented default umask of 0027 with jsvc and 
daemon.sh.
6b15b94 is described below

commit 6b15b94e0f5f2bed7a331f075190a952df220574
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Mar 30 15:49:24 2020 +0100

    BZ 64270. Use documented default umask of 0027 with jsvc and daemon.sh.
    
    https://bz.apache.org/bugzilla/show_bug.cgi?id=64270
    Also Make umask configurable.
---
 bin/daemon.sh              | 9 ++++++++-
 webapps/docs/changelog.xml | 6 ++++++
 2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/bin/daemon.sh b/bin/daemon.sh
index b5aa0c9..a44a1ed 100755
--- a/bin/daemon.sh
+++ b/bin/daemon.sh
@@ -90,7 +90,6 @@ test ".$MAX_FD" = . && MAX_FD="maximum"
 #
 test ".$TOMCAT_USER" = . && TOMCAT_USER=tomcat
 # Set JAVA_HOME to working JDK or JRE
-# JAVA_HOME=/opt/jdk-1.6.0.22
 # If not set we'll try to guess the JAVA_HOME
 # from java binary if on the PATH
 #
@@ -183,6 +182,12 @@ if [ "$cygwin" = "false" ]; then
     fi
 fi
 
+# Set UMASK unless it has been overridden
+if [ -z "$UMASK" ]; then
+    UMASK="0027"
+fi
+umask $UMASK
+
 # Java 9 no longer supports the java.endorsed.dirs
 # system property. Only try to use it if
 # JAVA_ENDORSED_DIRS was explicitly set
@@ -204,6 +209,7 @@ case "$1" in
       -java-home "\"$JAVA_HOME\"" \
       -pidfile "\"$CATALINA_PID\"" \
       -wait $SERVICE_START_WAIT_TIME \
+      -umask $UMASK \
       -nodetach \
       -outfile "\"&1\"" \
       -errfile "\"&2\"" \
@@ -223,6 +229,7 @@ case "$1" in
       -user $TOMCAT_USER \
       -pidfile "\"$CATALINA_PID\"" \
       -wait $SERVICE_START_WAIT_TIME \
+      -umask $UMASK \
       -outfile "\"$CATALINA_OUT\"" \
       -errfile "\"&1\"" \
       -classpath "\"$CLASSPATH\"" \
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f3778d8..73978e6 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,12 @@
         Expand the coverage of the Chinese translations provided with Apache
         Tomcat. Contribution provided by Lee Yazhou. (markt)
       </add>
+      <fix>
+        <bug>64270</bug>: Set the documented default umask of <code>0027</code>
+        when using jsvc via <code>daemon.sh</code> and allow the umask used to
+        be configured via the <code>UMASK</code> environment variable as it is
+        when using <code>catalina.sh</code>. (markt)
+      </fix>
     </changelog>
   </subsection>
 </section>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to