summaryrefslogtreecommitdiff
path: root/src/init
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-04-28 16:42:11 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-04-28 16:42:11 +0000
commit1c31b92725f8c121bed55d2f7446d6c7e7f7824e (patch)
tree1b8ffe4ecc4689d071eaa1a07556268d587b9513 /src/init
parente433e4088f0990009f9bb78757ad145317ba91ec (diff)
downloads6-linux-init-1c31b92725f8c121bed55d2f7446d6c7e7f7824e.tar.xz
Fix stage2 and stage3 invocation paths
Diffstat (limited to 'src/init')
-rw-r--r--src/init/s6-linux-init.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/init/s6-linux-init.c b/src/init/s6-linux-init.c
index 5223d54..b589ec3 100644
--- a/src/init/s6-linux-init.c
+++ b/src/init/s6-linux-init.c
@@ -41,12 +41,11 @@ static inline void run_stage2 (char const *basedir, char const **argv, unsigned
{
size_t dirlen = strlen(basedir) ;
char const *childargv[argc + 3] ;
- char fn[dirlen + 1 + sizeof(STAGE2)] ;
+ char fn[dirlen + sizeof("/scripts/" STAGE2)] ;
PROG = "s6-linux-init (child)" ;
argv[0] = PROG ;
memcpy(fn, basedir, dirlen) ;
- fn[dirlen] = '/' ;
- memcpy(fn + dirlen + 1, STAGE2, sizeof(STAGE2)) ;
+ memcpy(fn + dirlen, "/scripts/" STAGE2, sizeof("/scripts/" STAGE2)) ;
childargv[0] = fn ;
childargv[1] = scan_cmdline(initdefault, argv + 1, argc - 1) ;
for (unsigned int i = 0 ; i < argc ; i++)