Fix invocation of builtin shell to have proper argc and argv.
This commit is contained in:
parent
233817437d
commit
bc0f783a5f
4
chroot.c
4
chroot.c
@ -54,7 +54,9 @@ int chroot_main(int argc, char **argv)
|
||||
prog = "/bin/sh";
|
||||
execlp(prog, prog, NULL);
|
||||
#else
|
||||
shell_main(argc, argv);
|
||||
char shell[] = "/bin/sh";
|
||||
char *shell_argv[2] = { shell, NULL };
|
||||
shell_main(1, shell_argv);
|
||||
return EXIT_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
@ -54,7 +54,9 @@ int chroot_main(int argc, char **argv)
|
||||
prog = "/bin/sh";
|
||||
execlp(prog, prog, NULL);
|
||||
#else
|
||||
shell_main(argc, argv);
|
||||
char shell[] = "/bin/sh";
|
||||
char *shell_argv[2] = { shell, NULL };
|
||||
shell_main(1, shell_argv);
|
||||
return EXIT_SUCCESS;
|
||||
#endif
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user