diff options
Diffstat (limited to 'init')
| -rw-r--r-- | init/init.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/init/init.c b/init/init.c index e52517e91..2f44e13bf 100644 --- a/init/init.c +++ b/init/init.c | |||
| @@ -104,8 +104,6 @@ struct serial_struct { | |||
| 104 | 104 | ||
| 105 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) | 105 | #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) |
| 106 | 106 | ||
| 107 | #define SHELL "/bin/sh" /* Default shell */ | ||
| 108 | #define LOGIN_SHELL "-" SHELL /* Default login shell */ | ||
| 109 | #define INITTAB "/etc/inittab" /* inittab file location */ | 107 | #define INITTAB "/etc/inittab" /* inittab file location */ |
| 110 | #ifndef INIT_SCRIPT | 108 | #ifndef INIT_SCRIPT |
| 111 | #define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */ | 109 | #define INIT_SCRIPT "/etc/init.d/rcS" /* Default sysinit script. */ |
| @@ -180,7 +178,7 @@ static const int RB_AUTOBOOT = 0x01234567; | |||
| 180 | static const char * const environment[] = { | 178 | static const char * const environment[] = { |
| 181 | "HOME=/", | 179 | "HOME=/", |
| 182 | "PATH=" _PATH_STDPATH, | 180 | "PATH=" _PATH_STDPATH, |
| 183 | "SHELL=" SHELL, | 181 | "SHELL=/bin/sh", |
| 184 | "USER=root", | 182 | "USER=root", |
| 185 | NULL | 183 | NULL |
| 186 | }; | 184 | }; |
| @@ -526,7 +524,7 @@ static pid_t run(const struct init_action *a) | |||
| 526 | 524 | ||
| 527 | /* See if any special /bin/sh requiring characters are present */ | 525 | /* See if any special /bin/sh requiring characters are present */ |
| 528 | if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) { | 526 | if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) { |
| 529 | cmd[0] = SHELL; | 527 | cmd[0] = (char *)DEFAULT_SHELL; |
| 530 | cmd[1] = "-c"; | 528 | cmd[1] = "-c"; |
| 531 | cmd[2] = strcat(strcpy(buf, "exec "), a->command); | 529 | cmd[2] = strcat(strcpy(buf, "exec "), a->command); |
| 532 | cmd[3] = NULL; | 530 | cmd[3] = NULL; |
| @@ -840,7 +838,7 @@ static void child_handler(int sig) | |||
| 840 | 838 | ||
| 841 | #endif /* ! DEBUG_INIT */ | 839 | #endif /* ! DEBUG_INIT */ |
| 842 | 840 | ||
| 843 | static void new_init_action(int action, char *command, const char *cons) | 841 | static void new_init_action(int action, const char *command, const char *cons) |
| 844 | { | 842 | { |
| 845 | struct init_action *new_action, *a; | 843 | struct init_action *new_action, *a; |
| 846 | 844 | ||
| @@ -960,10 +958,10 @@ static void parse_inittab(void) | |||
| 960 | /* Prepare to restart init when a HUP is received */ | 958 | /* Prepare to restart init when a HUP is received */ |
| 961 | new_init_action(RESTART, "/sbin/init", ""); | 959 | new_init_action(RESTART, "/sbin/init", ""); |
| 962 | /* Askfirst shell on tty1-4 */ | 960 | /* Askfirst shell on tty1-4 */ |
| 963 | new_init_action(ASKFIRST, LOGIN_SHELL, ""); | 961 | new_init_action(ASKFIRST, bb_default_login_shell, ""); |
| 964 | new_init_action(ASKFIRST, LOGIN_SHELL, VC_2); | 962 | new_init_action(ASKFIRST, bb_default_login_shell, VC_2); |
| 965 | new_init_action(ASKFIRST, LOGIN_SHELL, VC_3); | 963 | new_init_action(ASKFIRST, bb_default_login_shell, VC_3); |
| 966 | new_init_action(ASKFIRST, LOGIN_SHELL, VC_4); | 964 | new_init_action(ASKFIRST, bb_default_login_shell, VC_4); |
| 967 | /* sysinit */ | 965 | /* sysinit */ |
| 968 | new_init_action(SYSINIT, INIT_SCRIPT, ""); | 966 | new_init_action(SYSINIT, INIT_SCRIPT, ""); |
| 969 | 967 | ||
| @@ -1116,7 +1114,7 @@ extern int init_main(int argc, char **argv) | |||
| 1116 | if (argc > 1 && (!strcmp(argv[1], "single") || | 1114 | if (argc > 1 && (!strcmp(argv[1], "single") || |
| 1117 | !strcmp(argv[1], "-s") || !strcmp(argv[1], "1"))) { | 1115 | !strcmp(argv[1], "-s") || !strcmp(argv[1], "1"))) { |
| 1118 | /* Start a shell on console */ | 1116 | /* Start a shell on console */ |
| 1119 | new_init_action(RESPAWN, LOGIN_SHELL, ""); | 1117 | new_init_action(RESPAWN, bb_default_login_shell, ""); |
| 1120 | } else { | 1118 | } else { |
| 1121 | /* Not in single user mode -- see what inittab says */ | 1119 | /* Not in single user mode -- see what inittab says */ |
| 1122 | 1120 | ||
