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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 81760d6ba4 Fix BZ 69902 - set file permissions in the ZIP distribution
81760d6ba4 is described below

commit 81760d6ba47024b69568774b2a6dd2af3fbf8800
Author: Armen Petrosyan <[email protected]>
AuthorDate: Sat Oct 17 15:19:51 2026 +0300

    Fix BZ 69902 - set file permissions in the ZIP distribution
    
    package-tgz sets explicit dirmode and filemode values on its tarfilesets
    but package-zip does not, so entries are stored with Ant's defaults,
    0644 for files and 0755 for directories, and the scripts in bin are not
    executable once the archive is extracted on a Unix platform. dist-static
    already marks them executable on disk; the mode is dropped at packaging
    time.
    
    Use the same modes as package-tgz: conf 0700 with 0600 contents, bin,
    lib, logs, temp, webapps and work 0750 with 0640 contents, the same for
    the top level text files, and the scripts in bin 0750. The bin/*.sh
    exclude keeps the scripts from being stored twice.
---
 build.xml                  | 12 ++++++++++--
 webapps/docs/changelog.xml |  6 ++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/build.xml b/build.xml
index 055a8b1237..df72212815 100644
--- a/build.xml
+++ b/build.xml
@@ -3250,9 +3250,11 @@ Configured for ${release.asfusername} to release Tomcat 
${version.major}.${versi
          modificationtime="${tstamp.iso.release}"
          encoding="UTF8">
       <zipfileset file="${tomcat.dist}" fullpath="${final.name}"/>
-      <zipfileset dir="${tomcat.dist}" prefix="${final.name}">
-        <include name="bin/**"/>
+      <zipfileset dir="${tomcat.dist}" dirmode="700" filemode="600" 
prefix="${final.name}">
         <include name="conf/**"/>
+      </zipfileset>
+      <zipfileset dir="${tomcat.dist}" dirmode="750" filemode="640" 
prefix="${final.name}">
+        <include name="bin/**"/>
         <include name="logs/**"/>
         <include name="lib/**"/>
         <include name="webapps/**"/>
@@ -3266,9 +3268,15 @@ Configured for ${release.asfusername} to release Tomcat 
${version.major}.${versi
         <include name="BUILDING.txt" />
         <include name="CONTRIBUTING.md"/>
         <exclude name="bin/service.bat"/>
+        <exclude name="bin/*.sh"/>
         <exclude name="bin/*.exe"/>
         <exclude name="bin/*.dll"/>
       </zipfileset>
+      <!-- These need to be added after the bin directory is added else the  
-->
+      <!-- bin directory will pick up the wrong permissions.                 
-->
+      <zipfileset dir="${tomcat.dist}" dirmode="750" filemode="750" 
prefix="${final.name}">
+        <include name="bin/*.sh"/>
+      </zipfileset>
     </zip>
 
     <hashAndSign file="${tomcat.release}/v${version}/bin/${final.name}.zip" />
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index b3719e5262..5fae60ac79 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -553,6 +553,12 @@
       <update>
         Bump spotbugs to 4.10.4.
       </update>
+      <update>
+        <bug>69902</bug>: Change the ZIP distribution to store the same file
+        and directory permissions as the tar.gz distribution so that the
+        scripts in <code>bin</code> are executable when the archive is
+        extracted on a Unix platform.
+      </update>
     </changelog>
   </subsection>
 </section>


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to