executable bit is lost on files when using directoryCopy() on binaries

Description

Test this on a *nix machine. Create a file and use chmod to mark it as executable

Then use Lucee's directoryCopy() function to copy the contents of that folder to another folder.

If you look at the foo file on the file system, you'll see it is no longer executable. This is causing big issues in CommandBox where users may package executable binaries to be installed and the executable flags get dropped which makes the binaries non longer work once they're installed.

I have tested on Adobe CF 2016 and it DOES preserve the executable bits on the files as it should. Note, the java.nio.file.Files class has some nice helper methods to use here.

https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#setPosixFilePermissions(java.nio.file.Path,%20java.util.Set)

https://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#getPosixFilePermissions(java.nio.file.Path,%20java.nio.file.LinkOption...)

Environment

None

Activity

Show:
Pothys - MitrahSoft
December 14, 2018, 3:19 PM

I've analyzed this ticket & confirmed the issue happened. If we copy the executable permission. file using directoryCopy(), the file looses the executable permission sames issue happens during zip the folder.

Michael Offner
July 15, 2019, 9:30 AM

Brad Wood
July 16, 2019, 5:05 PM

Thanks !

Fixed

Assignee

Michael Offner

Reporter

Brad Wood

Priority

Critical

Labels

Fix versions

Sprint

None
Configure