From d20bb177fbca7eea58def8114ac3b060fb2c910d Mon Sep 17 00:00:00 2001 From: andersen Date: Wed, 3 Jul 2002 05:44:18 +0000 Subject: Fix from vodz so that complex init commands actually work git-svn-id: svn://busybox.net/trunk/busybox@4995 69ca8d6d-28ef-0310-b511-8ec308f3f277 --- init/init.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'init') diff --git a/init/init.c b/init/init.c index e4812538d..8b68a0556 100644 --- a/init/init.c +++ b/init/init.c @@ -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 { -- cgit v1.2.3-55-g6feb