This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 8d6a439a73 Fix BZ 69902 - set file permissions in the ZIP distribution
8d6a439a73 is described below
commit 8d6a439a73d6846b41df537b29e9b6cd51f3f830
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 a3322029dd..87619e884b 100644
--- a/build.xml
+++ b/build.xml
@@ -3281,9 +3281,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/**"/>
@@ -3298,9 +3300,15 @@ Configured for ${release.asfusername} to release Tomcat
${version.major}.${versi
<include name="CONTRIBUTING.md"/>
<exclude name="bin/service.bat"/>
<exclude name="bin/x64/"/>
+ <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 af6ce6339a..ac4cbb64bb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -555,6 +555,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]