diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-06-29 20:20:14 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-06-29 20:20:14 +0000 |
commit | 5d41d60f1e78aceb92555596c3a58c13c65d4e5b (patch) | |
tree | 51ac3363a0e3e2eb955b8d3e8c5d6548e05f7e16 | |
parent | 2e1148b2393b1bcb72804a0c0de1408ca02a0189 (diff) | |
download | busybox-w32-5d41d60f1e78aceb92555596c3a58c13c65d4e5b.tar.gz busybox-w32-5d41d60f1e78aceb92555596c3a58c13c65d4e5b.tar.bz2 busybox-w32-5d41d60f1e78aceb92555596c3a58c13c65d4e5b.zip |
Added support for being a login shell, so things like '-su' or '-sh' (stuff
where argv[0][0]=='-') will now always invoke the shell. Now you can use
BusyBox as a login shell.
-Erik
-rw-r--r-- | Changelog | 3 | ||||
-rw-r--r-- | applets/busybox.c | 7 | ||||
-rw-r--r-- | busybox.c | 7 |
3 files changed, 17 insertions, 0 deletions
@@ -12,6 +12,9 @@ | |||
12 | Fix thanks to Arne Bernin <arne@matrix.loopback.org> | 12 | Fix thanks to Arne Bernin <arne@matrix.loopback.org> |
13 | * Added support for "sh -c command args...", thanks to | 13 | * Added support for "sh -c command args...", thanks to |
14 | Marius Groeger <mgroeger@sysgo.de> | 14 | Marius Groeger <mgroeger@sysgo.de> |
15 | * Added support for being a login shell, so things like | ||
16 | '-su' or '-sh' (stuff where argv[0][0]=='-') will now always | ||
17 | invoke the shell. Now you can use BusyBox as a login shell. | ||
15 | 18 | ||
16 | -Erik Andersen | 19 | -Erik Andersen |
17 | 20 | ||
diff --git a/applets/busybox.c b/applets/busybox.c index 48ca05408..486ef4d77 100644 --- a/applets/busybox.c +++ b/applets/busybox.c | |||
@@ -479,6 +479,13 @@ int main(int argc, char **argv) | |||
479 | 479 | ||
480 | *argv = name; | 480 | *argv = name; |
481 | 481 | ||
482 | #ifdef BB_SH | ||
483 | /* Add in a special case hack -- whenever **argv == '-' | ||
484 | * (i.e. '-su' or '-sh') always invoke the shell */ | ||
485 | if (**argv == '-') | ||
486 | exit(((*(shell_main)) (argc, argv))); | ||
487 | #endif | ||
488 | |||
482 | while (a->name != 0) { | 489 | while (a->name != 0) { |
483 | if (strcmp(name, a->name) == 0) { | 490 | if (strcmp(name, a->name) == 0) { |
484 | exit(((*(a->main)) (argc, argv))); | 491 | exit(((*(a->main)) (argc, argv))); |
@@ -479,6 +479,13 @@ int main(int argc, char **argv) | |||
479 | 479 | ||
480 | *argv = name; | 480 | *argv = name; |
481 | 481 | ||
482 | #ifdef BB_SH | ||
483 | /* Add in a special case hack -- whenever **argv == '-' | ||
484 | * (i.e. '-su' or '-sh') always invoke the shell */ | ||
485 | if (**argv == '-') | ||
486 | exit(((*(shell_main)) (argc, argv))); | ||
487 | #endif | ||
488 | |||
482 | while (a->name != 0) { | 489 | while (a->name != 0) { |
483 | if (strcmp(name, a->name) == 0) { | 490 | if (strcmp(name, a->name) == 0) { |
484 | exit(((*(a->main)) (argc, argv))); | 491 | exit(((*(a->main)) (argc, argv))); |