From f4f6e5144b9af71dc687dc14dba4a6caf8c28361 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 2 Dec 2020 21:51:08 +0100 Subject: libbb: exec_login_shell() - new function function old new delta exec_login_shell - 12 +12 sulogin_main 247 240 -7 login_main 960 953 -7 ------------------------------------------------------------------------------ (add/remove: 1/0 grow/shrink: 0/2 up/down: 12/-14) Total: -2 bytes Signed-off-by: Denys Vlasenko --- libbb/run_shell.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libbb') 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 bb_perror_msg_and_die("can't execute '%s'", shell); } +void FAST_FUNC exec_login_shell(const char *shell) +{ + exec_shell(shell, 1, NULL); +} + /* Typical idiom for applets which exec *optional* PROG [ARGS] */ void FAST_FUNC exec_prog_or_SHELL(char **argv) { if (argv[0]) { BB_EXECVP_or_die(argv); } - /* Why login=1? Both users (nsenter and unshare) do indeed exec + /* Both users (nsenter and unshare) do indeed exec * a _login_ shell (with dash in argv[0])! */ - exec_shell(getenv("SHELL"), /*login:*/ 1, NULL); + exec_login_shell(getenv("SHELL")); } -- cgit v1.2.3