aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Kraai <kraai@debian.org>2001-06-12 20:55:02 +0000
committerMatt Kraai <kraai@debian.org>2001-06-12 20:55:02 +0000
commit7bd773c9fe12ba78a9ab2041bc96f0cf1d453832 (patch)
treef699f05e05eb7424bee359eb7f8a2975b04f329e
parent0915c4b98533502b23b8021d0aa7b1a8c7f7ea4f (diff)
downloadbusybox-w32-7bd773c9fe12ba78a9ab2041bc96f0cf1d453832.tar.gz
busybox-w32-7bd773c9fe12ba78a9ab2041bc96f0cf1d453832.tar.bz2
busybox-w32-7bd773c9fe12ba78a9ab2041bc96f0cf1d453832.zip
Only use a login shell when it will run on a console.
-rw-r--r--init.c21
-rw-r--r--init/init.c21
2 files changed, 22 insertions, 20 deletions
diff --git a/init.c b/init.c
index 6369ef959..e057caa7e 100644
--- a/init.c
+++ b/init.c
@@ -124,7 +124,8 @@ static const int RB_AUTOBOOT = 0x01234567;
124#define VT_LOG "/dev/tty5" /* Virtual console */ 124#define VT_LOG "/dev/tty5" /* Virtual console */
125#define SERIAL_CON0 "/dev/ttyS0" /* Primary serial console */ 125#define SERIAL_CON0 "/dev/ttyS0" /* Primary serial console */
126#define SERIAL_CON1 "/dev/ttyS1" /* Serial console */ 126#define SERIAL_CON1 "/dev/ttyS1" /* Serial console */
127#define SHELL "-/bin/sh" /* Default shell */ 127#define SHELL "/bin/sh" /* Default shell */
128#define LOGIN_SHELL "-" SHELL /* Default login shell */
128#define INITTAB "/etc/inittab" /* inittab file location */ 129#define INITTAB "/etc/inittab" /* inittab file location */
129#ifndef INIT_SCRIPT 130#ifndef INIT_SCRIPT
130#define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */ 131#define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */
@@ -435,7 +436,7 @@ static pid_t run(char *command, char *terminal, int get_enter)
435 termType, 436 termType,
436 "HOME=/", 437 "HOME=/",
437 "PATH=/usr/bin:/bin:/usr/sbin:/sbin", 438 "PATH=/usr/bin:/bin:/usr/sbin:/sbin",
438 "SHELL=/bin/sh", 439 "SHELL=" SHELL,
439 "USER=root", 440 "USER=root",
440 NULL 441 NULL
441 }; 442 };
@@ -782,16 +783,16 @@ static void parse_inittab(void)
782 /* Umount all filesystems on halt/reboot */ 783 /* Umount all filesystems on halt/reboot */
783 new_initAction(SHUTDOWN, "/bin/umount -a -r", console); 784 new_initAction(SHUTDOWN, "/bin/umount -a -r", console);
784 /* Askfirst shell on tty1 */ 785 /* Askfirst shell on tty1 */
785 new_initAction(ASKFIRST, SHELL, console); 786 new_initAction(ASKFIRST, LOGIN_SHELL, console);
786 /* Askfirst shell on tty2 */ 787 /* Askfirst shell on tty2 */
787 if (secondConsole != NULL) 788 if (secondConsole != NULL)
788 new_initAction(ASKFIRST, SHELL, secondConsole); 789 new_initAction(ASKFIRST, LOGIN_SHELL, secondConsole);
789 /* Askfirst shell on tty3 */ 790 /* Askfirst shell on tty3 */
790 if (thirdConsole != NULL) 791 if (thirdConsole != NULL)
791 new_initAction(ASKFIRST, SHELL, thirdConsole); 792 new_initAction(ASKFIRST, LOGIN_SHELL, thirdConsole);
792 /* Askfirst shell on tty4 */ 793 /* Askfirst shell on tty4 */
793 if (fourthConsole != NULL) 794 if (fourthConsole != NULL)
794 new_initAction(ASKFIRST, SHELL, fourthConsole); 795 new_initAction(ASKFIRST, LOGIN_SHELL, fourthConsole);
795 /* sysinit */ 796 /* sysinit */
796 new_initAction(SYSINIT, INIT_SCRIPT, console); 797 new_initAction(SYSINIT, INIT_SCRIPT, console);
797 798
@@ -944,13 +945,13 @@ extern int init_main(int argc, char **argv)
944 !strcmp(argv[1], "-s") || !strcmp(argv[1], "1"))) { 945 !strcmp(argv[1], "-s") || !strcmp(argv[1], "1"))) {
945 /* Ask first then start a shell on tty2-4 */ 946 /* Ask first then start a shell on tty2-4 */
946 if (secondConsole != NULL) 947 if (secondConsole != NULL)
947 new_initAction(ASKFIRST, SHELL, secondConsole); 948 new_initAction(ASKFIRST, LOGIN_SHELL, secondConsole);
948 if (thirdConsole != NULL) 949 if (thirdConsole != NULL)
949 new_initAction(ASKFIRST, SHELL, thirdConsole); 950 new_initAction(ASKFIRST, LOGIN_SHELL, thirdConsole);
950 if (fourthConsole != NULL) 951 if (fourthConsole != NULL)
951 new_initAction(ASKFIRST, SHELL, fourthConsole); 952 new_initAction(ASKFIRST, LOGIN_SHELL, fourthConsole);
952 /* Start a shell on tty1 */ 953 /* Start a shell on tty1 */
953 new_initAction(RESPAWN, SHELL, console); 954 new_initAction(RESPAWN, LOGIN_SHELL, console);
954 } else { 955 } else {
955 /* Not in single user mode -- see what inittab says */ 956 /* Not in single user mode -- see what inittab says */
956 957
diff --git a/init/init.c b/init/init.c
index 6369ef959..e057caa7e 100644
--- a/init/init.c
+++ b/init/init.c
@@ -124,7 +124,8 @@ static const int RB_AUTOBOOT = 0x01234567;
124#define VT_LOG "/dev/tty5" /* Virtual console */ 124#define VT_LOG "/dev/tty5" /* Virtual console */
125#define SERIAL_CON0 "/dev/ttyS0" /* Primary serial console */ 125#define SERIAL_CON0 "/dev/ttyS0" /* Primary serial console */
126#define SERIAL_CON1 "/dev/ttyS1" /* Serial console */ 126#define SERIAL_CON1 "/dev/ttyS1" /* Serial console */
127#define SHELL "-/bin/sh" /* Default shell */ 127#define SHELL "/bin/sh" /* Default shell */
128#define LOGIN_SHELL "-" SHELL /* Default login shell */
128#define INITTAB "/etc/inittab" /* inittab file location */ 129#define INITTAB "/etc/inittab" /* inittab file location */
129#ifndef INIT_SCRIPT 130#ifndef INIT_SCRIPT
130#define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */ 131#define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */
@@ -435,7 +436,7 @@ static pid_t run(char *command, char *terminal, int get_enter)
435 termType, 436 termType,
436 "HOME=/", 437 "HOME=/",
437 "PATH=/usr/bin:/bin:/usr/sbin:/sbin", 438 "PATH=/usr/bin:/bin:/usr/sbin:/sbin",
438 "SHELL=/bin/sh", 439 "SHELL=" SHELL,
439 "USER=root", 440 "USER=root",
440 NULL 441 NULL
441 }; 442 };
@@ -782,16 +783,16 @@ static void parse_inittab(void)
782 /* Umount all filesystems on halt/reboot */ 783 /* Umount all filesystems on halt/reboot */
783 new_initAction(SHUTDOWN, "/bin/umount -a -r", console); 784 new_initAction(SHUTDOWN, "/bin/umount -a -r", console);
784 /* Askfirst shell on tty1 */ 785 /* Askfirst shell on tty1 */
785 new_initAction(ASKFIRST, SHELL, console); 786 new_initAction(ASKFIRST, LOGIN_SHELL, console);
786 /* Askfirst shell on tty2 */ 787 /* Askfirst shell on tty2 */
787 if (secondConsole != NULL) 788 if (secondConsole != NULL)
788 new_initAction(ASKFIRST, SHELL, secondConsole); 789 new_initAction(ASKFIRST, LOGIN_SHELL, secondConsole);
789 /* Askfirst shell on tty3 */ 790 /* Askfirst shell on tty3 */
790 if (thirdConsole != NULL) 791 if (thirdConsole != NULL)
791 new_initAction(ASKFIRST, SHELL, thirdConsole); 792 new_initAction(ASKFIRST, LOGIN_SHELL, thirdConsole);
792 /* Askfirst shell on tty4 */ 793 /* Askfirst shell on tty4 */
793 if (fourthConsole != NULL) 794 if (fourthConsole != NULL)
794 new_initAction(ASKFIRST, SHELL, fourthConsole); 795 new_initAction(ASKFIRST, LOGIN_SHELL, fourthConsole);
795 /* sysinit */ 796 /* sysinit */
796 new_initAction(SYSINIT, INIT_SCRIPT, console); 797 new_initAction(SYSINIT, INIT_SCRIPT, console);
797 798
@@ -944,13 +945,13 @@ extern int init_main(int argc, char **argv)
944 !strcmp(argv[1], "-s") || !strcmp(argv[1], "1"))) { 945 !strcmp(argv[1], "-s") || !strcmp(argv[1], "1"))) {
945 /* Ask first then start a shell on tty2-4 */ 946 /* Ask first then start a shell on tty2-4 */
946 if (secondConsole != NULL) 947 if (secondConsole != NULL)
947 new_initAction(ASKFIRST, SHELL, secondConsole); 948 new_initAction(ASKFIRST, LOGIN_SHELL, secondConsole);
948 if (thirdConsole != NULL) 949 if (thirdConsole != NULL)
949 new_initAction(ASKFIRST, SHELL, thirdConsole); 950 new_initAction(ASKFIRST, LOGIN_SHELL, thirdConsole);
950 if (fourthConsole != NULL) 951 if (fourthConsole != NULL)
951 new_initAction(ASKFIRST, SHELL, fourthConsole); 952 new_initAction(ASKFIRST, LOGIN_SHELL, fourthConsole);
952 /* Start a shell on tty1 */ 953 /* Start a shell on tty1 */
953 new_initAction(RESPAWN, SHELL, console); 954 new_initAction(RESPAWN, LOGIN_SHELL, console);
954 } else { 955 } else {
955 /* Not in single user mode -- see what inittab says */ 956 /* Not in single user mode -- see what inittab says */
956 957