diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2021-01-19 08:41:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-19 08:41:15 +0100 |
commit | f1fb046a985521f7d4a662f02546686ff20b7e5d (patch) | |
tree | 2c61e56270f7067757ebf0c961f1bb0926024e94 /src/analyze | |
parent | 29d65a4388ab50d43b10970d77458dc32326a311 (diff) | |
parent | b9b442a0ccb6e8f0b351412eb406cad30d622b9f (diff) | |
download | systemd-f1fb046a985521f7d4a662f02546686ff20b7e5d.tar.gz |
Merge pull request #18300 from yuwata/analyze-verify-18252
analyze: resolve executable path if it is relative
Diffstat (limited to 'src/analyze')
-rw-r--r-- | src/analyze/analyze-verify.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/analyze/analyze-verify.c b/src/analyze/analyze-verify.c index a9c89173bf..bf28624d41 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; } |