diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch')
-rw-r--r-- | meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch b/meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch new file mode 100644 index 0000000000..fd7f94a61d --- /dev/null +++ b/meta/recipes-core/systemd/systemd/0001-analyze-resolve-executable-path-if-it-is-relative.patch | |||
@@ -0,0 +1,39 @@ | |||
1 | From b9b7a8e3825f0433e120f7a6d7d5d635a839cab9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Mingli Yu <mingli.yu@windriver.com> | ||
3 | Date: Thu, 21 Jan 2021 06:19:44 +0000 | ||
4 | Subject: [PATCH] analyze: resolve executable path if it is relative | ||
5 | |||
6 | Upstream-Status: Backport [https://github.com/systemd/systemd/commit/f1fb046a985521f7d4a662f02546686ff20b7e5d] | ||
7 | |||
8 | Signed-off-by: Mingli Yu <mingli.yu@windriver.com> | ||
9 | --- | ||
10 | src/analyze/analyze-verify.c | 7 +++++-- | ||
11 | 1 file changed, 5 insertions(+), 2 deletions(-) | ||
12 | |||
13 | diff --git a/src/analyze/analyze-verify.c b/src/analyze/analyze-verify.c | ||
14 | index a9c89173bf..969523df18 100644 | ||
15 | --- a/src/analyze/analyze-verify.c | ||
16 | +++ b/src/analyze/analyze-verify.c | ||
17 | @@ -115,14 +115,17 @@ static int verify_socket(Unit *u) { | ||
18 | } | ||
19 | |||
20 | int verify_executable(Unit *u, const ExecCommand *exec) { | ||
21 | + int r; | ||
22 | + | ||
23 | if (!exec) | ||
24 | return 0; | ||
25 | |||
26 | if (exec->flags & EXEC_COMMAND_IGNORE_FAILURE) | ||
27 | return 0; | ||
28 | |||
29 | - if (access(exec->path, X_OK) < 0) | ||
30 | - return log_unit_error_errno(u, errno, "Command %s is not executable: %m", exec->path); | ||
31 | + r = find_executable_full(exec->path, false, NULL); | ||
32 | + if (r < 0) | ||
33 | + return log_unit_error_errno(u, r, "Command %s is not executable: %m", exec->path); | ||
34 | |||
35 | return 0; | ||
36 | } | ||
37 | -- | ||
38 | 2.26.2 | ||
39 | |||