1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-06 13:17:44 +03:00

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 ccc2e1ff85)
This commit is contained in:
Lennart Poettering 2024-11-05 11:54:14 +01:00 committed by Luca Boccassi
parent 17a3a8e91b
commit 8e353d2293

View File

@ -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) {