aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2007-12-03 20:05:14 -0600
committerRob Landley <rob@landley.net>2007-12-03 20:05:14 -0600
commitebff8ee282dd2eee7c2fd9da0587573520b41df0 (patch)
tree0ac87357d236ee09b62ca3f2d77d5621758fd068
parent64d2e8227ece1fcd8c1d7366f52913ae35cf6c20 (diff)
downloadtoybox-ebff8ee282dd2eee7c2fd9da0587573520b41df0.tar.gz
Other chroots fall back to "/bin/sh -i", so add the -i.
-rw-r--r--toys/chroot.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/toys/chroot.c b/toys/chroot.c
index 0126d968..8d2e9aa2 100644
--- a/toys/chroot.c
+++ b/toys/chroot.c
@@ -1,13 +1,15 @@
/* vi: set sw=4 ts=4: */
/*
* chroot.c - Run command in new root directory.
+ *
+ * Not in SUSv3.
*/
#include "toys.h"
void chroot_main(void)
{
- char *binsh[] = {"/bin/sh", 0};
+ char *binsh[] = {"/bin/sh", "-i", 0};
if (chdir(*toys.optargs) || chroot("."))
perror_exit("%s", *toys.optargs);
xexec(toys.optargs[1] ? toys.optargs+1 : binsh);