mirror of
https://github.com/sheumann/hush.git
synced 2024-12-22 14:30:31 +00:00
Fix from vodz so that complex init commands actually work
This commit is contained in:
parent
8c4025e708
commit
796446718d
@ -579,9 +579,7 @@ static pid_t run(struct init_action *a)
|
|||||||
if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) {
|
if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) {
|
||||||
cmd[0] = SHELL;
|
cmd[0] = SHELL;
|
||||||
cmd[1] = "-c";
|
cmd[1] = "-c";
|
||||||
strcpy(buf, "exec ");
|
snprintf(buf, sizeof(buf), "exec %s", a->command);
|
||||||
safe_strncpy(buf + sizeof("exec "), a->command,
|
|
||||||
sizeof(buf) - sizeof("exec "));
|
|
||||||
cmd[2] = buf;
|
cmd[2] = buf;
|
||||||
cmd[3] = NULL;
|
cmd[3] = NULL;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user