diff options
Diffstat (limited to 'src/run/run.c')
-rw-r--r-- | src/run/run.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/run/run.c b/src/run/run.c index 93d8cd1d08..38a482bb11 100644 --- a/src/run/run.c +++ b/src/run/run.c @@ -25,11 +25,13 @@ #include "sd-bus.h" #include "sd-event.h" +#include "alloc-util.h" #include "bus-error.h" #include "bus-util.h" #include "calendarspec.h" #include "env-util.h" #include "event-util.h" +#include "fd-util.h" #include "formats-util.h" #include "path-util.h" #include "ptyfwd.h" @@ -38,6 +40,8 @@ #include "strv.h" #include "terminal-util.h" #include "unit-name.h" +#include "user-util.h" +#include "parse-util.h" static bool arg_ask_password = true; static bool arg_scope = false; @@ -1153,14 +1157,15 @@ int main(int argc, char* argv[]) { if (r <= 0) goto finish; - if (argc > optind) { - r = find_binary(argv[optind], arg_transport == BUS_TRANSPORT_LOCAL, &command); + if (argc > optind && arg_transport == BUS_TRANSPORT_LOCAL) { + /* Patch in an absolute path */ + + r = find_binary(argv[optind], &command); if (r < 0) { - log_error_errno(r, "Failed to find executable %s%s: %m", - argv[optind], - arg_transport == BUS_TRANSPORT_LOCAL ? "" : " on local system"); + log_error_errno(r, "Failed to find executable %s: %m", argv[optind]); goto finish; } + argv[optind] = command; } |