From e9901e30a2f1bf52aee83359a318f7314131f816 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Mon, 1 Mar 2021 19:29:27 -0500 Subject: Only prepend exec if command line doesn't contain ;&|() --- service.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'service.c') diff --git a/service.c b/service.c index 4ea9126..38049ff 100644 --- a/service.c +++ b/service.c @@ -246,7 +246,9 @@ void serviceStart(struct Service *service) { if (len >= sizeof(command)) errx(ExitNoExec, "command truncated"); } int n = snprintf( - &command[len], sizeof(command) - len, "exec %s", service->command + &command[len], sizeof(command) - len, "%s%s", + (service->command[strcspn(service->command, ";&|()")] ? "exec " : ""), + service->command ); assert(n > 0); len += n; -- cgit 1.4.1