Skip to content

CMake executable detection does not account for directories correctly on UNIX #1

@eviltak

Description

@eviltak

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions