mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-05 21:31:08 -06:00
find_program: Find programs that are executable but not readable
`find_program` internally uses `cmSystemTools::FileExists` which calls `access(R_OK)` instead of `access(X_OK)`. Use `cmSystemTools::IsFileExecutable` instead to fix this issue. An example of such a program is `sudo`. Fixes: #10468
This commit is contained in:
committed by
Brad King
parent
df543e37f1
commit
86e6349ef7
@@ -85,7 +85,7 @@ struct cmFindProgramHelper
|
||||
this->TestNameExt = cmStrCat(name, ext);
|
||||
this->TestPath =
|
||||
cmSystemTools::CollapseFullPath(this->TestNameExt, path);
|
||||
bool exists = cmSystemTools::FileExists(this->TestPath, true);
|
||||
bool exists = cmSystemTools::FileIsExecutable(this->TestPath);
|
||||
exists ? this->DebugSearches.FoundAt(this->TestPath)
|
||||
: this->DebugSearches.FailedAt(this->TestPath);
|
||||
if (exists) {
|
||||
|
||||
Reference in New Issue
Block a user