aboutsummaryrefslogtreecommitdiff
path: root/loginutils/login.c
diff options
context:
space:
mode:
authorGravatar Ladislav Michl <Ladislav.Michl@seznam.cz>2010-06-27 03:23:31 +0200
committerGravatar Denys Vlasenko <vda.linux@googlemail.com>2010-06-27 03:23:31 +0200
commita73b87e9343df2a6f14e328a977e7b70eb3ed707 (patch)
tree564869bde93c870b20f6d4d8a3da71e42b629f2e /loginutils/login.c
parent1b14cdb27ca5e8104a824424731be430c8592dd6 (diff)
downloadbusybox-a73b87e9343df2a6f14e328a977e7b70eb3ed707.tar.gz
busybox-a73b87e9343df2a6f14e328a977e7b70eb3ed707.tar.bz2
*: s/"/bin/sh"/DEFAULT_SHELL, run_shell() API fix, remove unneeded strdup
function old new delta run_shell 157 166 +9 su_main 477 470 -7 sulogin_main 515 503 -12 Signed-off-by: Ladislav Michl <Ladislav.Michl@seznam.cz> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils/login.c')
-rw-r--r--loginutils/login.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index 078cd68ed..88ed0af78 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -201,7 +201,7 @@ int login_main(int argc UNUSED_PARAM, char **argv)
};
char *fromhost;
char username[USERNAME_SIZE];
- const char *tmp;
+ const char *shell;
int run_by_root;
unsigned opt;
int count = 0;
@@ -389,10 +389,10 @@ int login_main(int argc UNUSED_PARAM, char **argv)
run_login_script(pw, full_tty);
change_identity(pw);
- tmp = pw->pw_shell;
- if (!tmp || !*tmp)
- tmp = DEFAULT_SHELL;
- setup_environment(tmp,
+ shell = pw->pw_shell;
+ if (!shell || !shell[0])
+ shell = DEFAULT_SHELL;
+ setup_environment(shell,
(!(opt & LOGIN_OPT_p) * SETUP_ENV_CLEARENV) + SETUP_ENV_CHANGEENV,
pw);
@@ -427,7 +427,7 @@ int login_main(int argc UNUSED_PARAM, char **argv)
signal(SIGINT, SIG_DFL);
/* Exec login shell with no additional parameters */
- run_shell(tmp, 1, NULL, NULL);
+ run_shell(shell, 1, NULL, NULL);
/* return EXIT_FAILURE; - not reached */
}