summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog1
-rw-r--r--chroot.c5
-rw-r--r--coreutils/chroot.c5
3 files changed, 11 insertions, 0 deletions
diff --git a/Changelog b/Changelog
index 16c2ba1..ac7dba3 100644
--- 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.
diff --git a/chroot.c b/chroot.c
index 9b1a5a8..e8ce539 100644
--- 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));
diff --git a/coreutils/chroot.c b/coreutils/chroot.c
index 9b1a5a8..e8ce539 100644
--- a/coreutils/chroot.c
+++ b/coreutils/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));