]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
run: handle gracefully if we can't find binary client-side due to perms
authorLennart Poettering <lennart@poettering.net>
Tue, 5 Nov 2024 10:54:14 +0000 (11:54 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Tue, 5 Nov 2024 13:41:20 +0000 (13:41 +0000)
Fixes: #35022
src/run/run.c

index e4bcc5d5993d7df48476bfff66cc8cbc5ac7a93d..5a1df9ce8f69dc6de8ae6838ab7303844ee1f454 100644 (file)
@@ -2576,10 +2576,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_NEG_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) {