From: Zbigniew Jędrzejewski-Szmek Date: Wed, 16 Sep 2020 08:19:25 +0000 (+0200) Subject: core: use X_OK when looking for executables X-Git-Tag: v247-rc1~176^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=831d57953e8e688128bc0f871d4b4213459842ba;p=thirdparty%2Fsystemd.git 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. --- diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c index 701ed7487d5..617adb848e0 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;