Skip to content

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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