patch-2.1.9 linux/init/main.c

Next file: linux/kernel/ksyms.c
Previous file: linux/include/net/tcp.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.8/linux/init/main.c linux/init/main.c
@@ -220,9 +220,6 @@
 static char * argv_rc[] = { "/bin/sh", NULL };
 static char * envp_rc[] = { "HOME=/", "TERM=linux", NULL };
 
-static char * argv[] = { "-/bin/sh",NULL };
-static char * envp[] = { "HOME=/usr/root", "TERM=linux", NULL };
-
 char *get_options(char *str, int *ints)
 {
 	char *cur = str;
@@ -882,12 +879,16 @@
 
 static int do_shell(void * shell)
 {
+	char *argv[2];
+
 	close(0);close(1);close(2);
 	setsid();
 	(void) open("/dev/tty1",O_RDWR,0);
 	(void) dup(0);
 	(void) dup(0);
-	return execve(shell, argv, envp);
+	argv[0] = shell;
+	argv[1] = NULL;
+	return execve(shell, argv, envp_rc);
 }
 
 #ifdef CONFIG_BLK_DEV_INITRD

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov