Issues
setMode fails on linux using extract("tgz") due to directory mask 40700 instead of 700
Description
Environment
blocks
relates to
Details
Assignee
Pothys - MitrahSoftPothys - MitrahSoftReporter
Zac SpitzerZac SpitzerPriority
NewNew 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
NoneAffects versions
Details
Details
Assignee
Reporter
Priority
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
Activity
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 Spitzer29 December 2024 at 09:53
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
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
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: directoryDelete( "src-tomcat/linux/webapps", true );<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