As per the documentation of java.nio.file.Files.isExecutable, the method can return true when passed a directory on UNIX systems. This causes the Executables.isPathValid helper to incorrectly return true when given a directory named cmake.
Replication
- Create a directory called
cmake under the current working directory
- Run
CMakeInstance.generate() in the same working directory.
- The
cmake directory will incorrectly be assumed to be a cmake executable, and CMakeInstance will attempt to execute it.
Potential fix
Add a Files.isDirectory disqualification check to the isPathValid helper.
As per the documentation of
java.nio.file.Files.isExecutable, the method can return true when passed a directory on UNIX systems. This causes theExecutables.isPathValidhelper to incorrectly return true when given a directory namedcmake.Replication
cmakeunder the current working directoryCMakeInstance.generate()in the same working directory.cmakedirectory will incorrectly be assumed to be acmakeexecutable, andCMakeInstancewill attempt to execute it.Potential fix
Add a
Files.isDirectorydisqualification check to theisPathValidhelper.