main: fix the case where user has "halt" as login shell. Closes 9986
halt::0:0::/:/sbin/halt function old new delta run_applet_and_exit 748 751 +3 run_applet_no_and_exit 467 459 -8 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
@@ -7717,7 +7717,7 @@ tryexec(IF_FEATURE_SH_STANDALONE(int applet_no,) char *cmd, char **argv, char **
|
||||
clearenv();
|
||||
while (*envp)
|
||||
putenv(*envp++);
|
||||
run_applet_no_and_exit(applet_no, argv);
|
||||
run_applet_no_and_exit(applet_no, cmd, argv);
|
||||
}
|
||||
/* re-exec ourselves with the new arguments */
|
||||
execve(bb_busybox_exec_path, argv, envp);
|
||||
|
||||
@@ -7063,7 +7063,7 @@ static NOINLINE void pseudo_exec_argv(nommu_save_t *nommu_save,
|
||||
/* Do not leak open fds from opened script files etc */
|
||||
close_all_FILE_list();
|
||||
debug_printf_exec("running applet '%s'\n", argv[0]);
|
||||
run_applet_no_and_exit(a, argv);
|
||||
run_applet_no_and_exit(a, argv[0], argv);
|
||||
}
|
||||
# endif
|
||||
/* Re-exec ourselves */
|
||||
|
||||
Reference in New Issue
Block a user