changeset 193:0efba0e70c43

Other chroots fall back to "/bin/sh -i", so add the -i.
author Rob Landley <rob@landley.net>
date Mon, 03 Dec 2007 20:05:14 -0600
parents 8c0809cee2b0
children 30a6db5a95c2
files toys/chroot.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/toys/chroot.c	Mon Dec 03 19:59:34 2007 -0600
+++ b/toys/chroot.c	Mon Dec 03 20:05:14 2007 -0600
@@ -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);