diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/run_shell.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libbb/run_shell.c b/libbb/run_shell.c index 9bec43b7c..c22bba87b 100644 --- a/libbb/run_shell.c +++ b/libbb/run_shell.c | |||
@@ -84,14 +84,19 @@ void FAST_FUNC exec_shell(const char *shell, int loginshell, const char **additi | |||
84 | bb_perror_msg_and_die("can't execute '%s'", shell); | 84 | bb_perror_msg_and_die("can't execute '%s'", shell); |
85 | } | 85 | } |
86 | 86 | ||
87 | void FAST_FUNC exec_login_shell(const char *shell) | ||
88 | { | ||
89 | exec_shell(shell, 1, NULL); | ||
90 | } | ||
91 | |||
87 | /* Typical idiom for applets which exec *optional* PROG [ARGS] */ | 92 | /* Typical idiom for applets which exec *optional* PROG [ARGS] */ |
88 | void FAST_FUNC exec_prog_or_SHELL(char **argv) | 93 | void FAST_FUNC exec_prog_or_SHELL(char **argv) |
89 | { | 94 | { |
90 | if (argv[0]) { | 95 | if (argv[0]) { |
91 | BB_EXECVP_or_die(argv); | 96 | BB_EXECVP_or_die(argv); |
92 | } | 97 | } |
93 | /* Why login=1? Both users (nsenter and unshare) do indeed exec | 98 | /* Both users (nsenter and unshare) do indeed exec |
94 | * a _login_ shell (with dash in argv[0])! | 99 | * a _login_ shell (with dash in argv[0])! |
95 | */ | 100 | */ |
96 | exec_shell(getenv("SHELL"), /*login:*/ 1, NULL); | 101 | exec_login_shell(getenv("SHELL")); |
97 | } | 102 | } |