This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 040014bb45 Fix BZ 69902 - set file permissions in the ZIP distribution
040014bb45 is described below
commit 040014bb45ce8aa3547dd6e5f1c5a9e6672204b5
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 82e69f02a1..ed58717d17 100644
--- a/build.xml
+++ b/build.xml
@@ -3280,9 +3280,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/**"/>
@@ -3297,9 +3299,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 89ac2decb9..50f80544d2 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -544,6 +544,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]