core: use X_OK when looking for executables

Other tools silently ignore non-executable names found in path. By checking
F_OK, we would could pick non-executable path even though there is an executable
one later.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-09-16 10:19:25 +02:00
parent 598c47c86e
commit 831d57953e

View file

@ -808,7 +808,7 @@ int config_parse_exec(
if (!fullpath)
return log_oom();
if (access(fullpath, F_OK) >= 0) {
if (access(fullpath, X_OK) >= 0) {
free_and_replace(path, fullpath);
found = true;
break;