From 831d57953e8e688128bc0f871d4b4213459842ba Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 16 Sep 2020 10:19:25 +0200 Subject: [PATCH] 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. --- src/core/load-fragment.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 701ed7487d..617adb848e 100644 --- a/src/core/load-fragment.c +++ b/src/core/load-fragment.c @@ -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; -- 2.25.1