Issues

Select view

Select search mode

 

setMode fails on linux using extract("tgz") due to directory mask 40700 instead of 700

Fixed

Description

Found this while automating Lucee installler to determine and download in cfml, the latest java and tomcat versions,

which is blocking building the new installer for the 6.1.0.243 release with java 21

https://github.com/lucee/lucee-installer/actions/runs/10014301563/job/27683744904#step:8:325

[java] [script] 34: <br> [java] [script] 35: &nbsp;&nbsp;&nbsp;directoryDelete(&nbsp;&quot;src-tomcat/linux/webapps&quot;,&nbsp;true&nbsp;);<br> [java] [script] "}],"ErrorCode":"0","type":"java.io.IOException","StackTrace":"lucee.runtime.exp.NativeException: chmod [40700] [/home/runner/work/_actions/lucee/script-runner/main/temp/lucee/lucee-server/context/temp/tmp-installer-C5A076CB-C60A-4E6E-B415328B6B21604B/apache-tomcat-9.0.91/conf] failed [java] [script] at lucee.commons.io.res.type.file.FileResource.setMode(FileResource.java:441) [java] [script] at lucee.commons.io.compress.CompressUtil.extractTar(CompressUtil.java:226) [java] [script] at lucee.commons.io.compress.CompressUtil.extractTGZ(CompressUtil.java:133) [java] [script] at lucee.commons.io.compress.CompressUtil.extract(CompressUtil.java:113) [java] [script] at lucee.commons.io.compress.CompressUtil.extract(CompressUtil.java:191) [java] [script] at lucee.runtime.functions.system.Extract.call(Extract.java:78) [java] [script] at download_latest_java_tomcat_cfm2070$cf.udfCall(/download-latest-java-tomcat.cfm:48)

https://github.com/lucee/Lucee/blob/6.1/core/src/main/java/lucee/commons/io/res/type/file/FileResource.java#L447

it’s actually shelling out to chmod

Runtime.getRuntime().exec(new String[] { "chmod", ModeUtil.toStringMode(mode), getPath() })

Happens while extracting https://dlcdn.apache.org/tomcat/tomcat-9/v9.0.91/bin/apache-tomcat-9.0.91.tar.gz

Environment

None

Details

Assignee

Reporter

Priority

Fix versions

New Issue warning screen

Before you create a new Issue, please post to the mailing list first https://dev.lucee.org

Once the issue has been verified, one of the Lucee team will ask you to file an issue

Sprint

Affects versions

Created 19 July 2024 at 21:14
Updated 31 December 2024 at 11:43
Resolved 19 August 2024 at 19:38

Activity

Show:

Pothys - MitrahSoft31 December 2024 at 11:43

I've checked this ticket with Lucee versions 6.1.1.59 and 6.2.0.265. The issue is now resolved and no longer throws an error.

Zac Spitzer28 December 2024 at 22:26

restored the setting of permissions on extract

test case surfaced that the compressTar didn’t add directories either, which I have addressed in this PR

https://github.com/lucee/Lucee/pull/2463

also improved the FileResource getMode and setMode to no longer shell out to ls and chmod

https://luceeserver.atlassian.net/browse/LDEV-5227

Zac Spitzer4 November 2024 at 09:03

but it no longer extracts any perrmissions, it works but the result is useless for creating installers (which is the original source problem)

you made these changes to the test case, so it doesn't actually test if the extracted permissions match anymore? but it doesn’t crash

https://github.com/lucee/Lucee/commit/48805f3402c975cca11b0f081b96d12f5aabb965

Flag notifications