This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 0ab609727a Fix BZ 69902 - set file permissions in the ZIP distribution
0ab609727a is described below
commit 0ab609727a89e5379adc5444af1462fde3edcd2a
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 307bd92897..fbf9148cf5 100644
--- a/build.xml
+++ b/build.xml
@@ -3238,9 +3238,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/**"/>
@@ -3254,9 +3256,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 4c270ca472..655258d1d5 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -863,6 +863,12 @@
(<code>output/coverage/jacoco.xml</code>) alongside the existing HTML
report when the build is run with code coverage enabled. (dsoumis)
</add>
+ <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>
<!-- Entries for backport and removal before 12.0.0-M1 below this line
-->
</changelog>
</subsection>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]