chroot can now call the builtin shell
authorPavel Roskin <proski@gnu.org>
Mon, 24 Jul 2000 20:15:30 +0000 (20:15 -0000)
committerPavel Roskin <proski@gnu.org>
Mon, 24 Jul 2000 20:15:30 +0000 (20:15 -0000)
Changelog
chroot.c
coreutils/chroot.c

index 16c2ba1ed68d2ed78bd7609e363b6b8d60807877..ac7dba32cb3796931b398f29abf325a0754e9dd8 100644 (file)
--- a/Changelog
+++ b/Changelog
@@ -1,5 +1,6 @@
 0.47pre
 
+       * chroot can now call the builtin shell - Pavel Roskin <proski@gnu.org>
        * added 'renice' command -- thanks to Dave Cinege <dcinege@psychosis.com>
        * 'make install' now creates relative symlinks, and added a new
            'make install-hardlinks' target to (tada) install hardlinks.
index 9b1a5a82d82dbd434efafb8bb43fb69c110e69c8..e8ce539732490eacb2a07a25ec1b2de6a78c0687 100644 (file)
--- a/chroot.c
+++ b/chroot.c
@@ -47,10 +47,15 @@ int chroot_main(int argc, char **argv)
                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));
 
index 9b1a5a82d82dbd434efafb8bb43fb69c110e69c8..e8ce539732490eacb2a07a25ec1b2de6a78c0687 100644 (file)
@@ -47,10 +47,15 @@ int chroot_main(int argc, char **argv)
                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));