From 8e353d229345bf950b86bfd99bab55c971827f18 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 5 Nov 2024 11:54:14 +0100 Subject: [PATCH] run: handle gracefully if we can't find binary client-side due to perms Fixes: #35022 (cherry picked from commit 9810899ef2f28fbb42cf659e6892b1a5074cfc83) (cherry picked from commit 070dbe1e77fc25201a89770beb691135ce84bed1) (cherry picked from commit ccc2e1ff85433cef5df6891d0579dc66095964db) --- src/run/run.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/run/run.c b/src/run/run.c index ee77754b1d..e49c745d27 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -1888,10 +1888,12 @@ static int run(int argc, char* argv[]) { _cleanup_free_ char *command = NULL; r = find_executable(arg_cmdline[0], &command); - if (r < 0) + if (ERRNO_IS_PRIVILEGE(r)) + log_debug_errno(r, "Failed to find executable '%s' due to permission problems, leaving path as is: %m", arg_cmdline[0]); + else if (r < 0) return log_error_errno(r, "Failed to find executable %s: %m", arg_cmdline[0]); - - free_and_replace(arg_cmdline[0], command); + else + free_and_replace(arg_cmdline[0], command); } if (!arg_description) {