From: Yu Watanabe Date: Mon, 18 Jan 2021 19:40:26 +0000 (+0900) Subject: analyze: resolve executable path if it is relative X-Git-Tag: v248-rc1~302^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F18300%2Fhead;p=thirdparty%2Fsystemd.git analyze: resolve executable path if it is relative Fixes #18252. --- diff --git a/src/analyze/analyze-verify.c b/src/analyze/analyze-verify.c index a9c89173bfa..bf28624d41f 100644 --- a/src/analyze/analyze-verify.c +++ b/src/analyze/analyze-verify.c @@ -115,14 +115,17 @@ static int verify_socket(Unit *u) { } int verify_executable(Unit *u, const ExecCommand *exec) { + int r; + if (!exec) return 0; if (exec->flags & EXEC_COMMAND_IGNORE_FAILURE) return 0; - if (access(exec->path, X_OK) < 0) - return log_unit_error_errno(u, errno, "Command %s is not executable: %m", exec->path); + r = find_executable_full(exec->path, false, NULL, NULL); + if (r < 0) + return log_unit_error_errno(u, r, "Command %s is not executable: %m", exec->path); return 0; }