From e034b2fb9e015f6fe6195e8d92ccd57b37cde23d Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Fri, 16 Jan 2015 13:23:06 -0800 Subject: [PATCH] stage1/enter: supply a working directory to diagexec This is currently statically set to "/"; /enter isn't currently supplied a work directory for the app being entered. --- stage1/rootfs/enter/enter.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stage1/rootfs/enter/enter.c b/stage1/rootfs/enter/enter.c index 4675d50..0508bfd 100644 --- a/stage1/rootfs/enter/enter.c +++ b/stage1/rootfs/enter/enter.c @@ -90,7 +90,7 @@ int main(int argc, char *argv[]) if(child == 0) { char path[PATH_MAX]; - char *args[argc + 1]; + char *args[argc + 2]; int i; /* Child goes on to execute /diagexec */ @@ -101,10 +101,11 @@ int main(int argc, char *argv[]) args[0] = "/diagexec"; args[1] = path; + args[2] = "/"; /* TODO(vc): plumb this into app.WorkingDirectory */ for(i = 2; i < argc; i++) { - args[i] = argv[i]; + args[i + 1] = argv[i]; } - args[i] = NULL; + args[i + 1] = NULL; exit_if(execv(args[0], args) == -1, "exec failed");