[BusyBox] Crazy idea for chroot
Erik Andersen
andersen at lineo.com
Fri Jul 21 15:23:39 UTC 2000
On Fri Jul 21, 2000 at 10:27:55AM -0400, Pavel Roskin wrote:
> Hello!
>
> What do you this about this patch:
>
> ===================
> --- chroot.c Sun Jul 16 21:18:38 2000
> +++ chroot.c Fri Jul 21 10:04:45 2000
> @@ -47,10 +47,15 @@
> prog = *argv;
> execvp(*argv, argv);
> } else {
> +#ifndef BB_SH
> prog = getenv("SHELL");
> if (!prog)
> prog = "/bin/sh";
> execlp(prog, prog, NULL);
> +#else
> + shell_main(argc, argv);
> + exit (0);
> +#endif
> }
> fatalError("cannot execute %s: %s\n", prog, strerror(errno));
>
> ===================
>
> It means that if both chroot and sh are enabled in busybox and you don't
> specify the shell, the internal shell is used. You can still specify
> /bin/sh if you want.
>
> The most funny thing is that you can chroot to an empty directory and have
> all the embedded commands available!
>
> Ok to apply?
Hmm. Thats prety cool. Do it. :-)
-Erik
--
Erik B. Andersen email: andersen at lineo.com
--This message was written using 73% post-consumer electrons--
More information about the busybox
mailing list