← Commit list

796446718

Eric Andersen
Eric Andersen
2002-07-03
FAILED Duration: 5s

Subject

Fix from vodz so that complex init commands actually work

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

init/init.c+1 -3
@@ -579,9 +579,7 @@ static pid_t run(struct init_action *a)
if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) {
cmd[0] = SHELL;
cmd[1] = "-c";
- strcpy(buf, "exec ");
- safe_strncpy(buf + sizeof("exec "), a->command,
- sizeof(buf) - sizeof("exec "));
+ snprintf(buf, sizeof(buf), "exec %s", a->command);
cmd[2] = buf;
cmd[3] = NULL;
} else {