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 16c2ba1..ac7dba3 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 9b1a5a8..e8ce539 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 9b1a5a8..e8ce539 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));