summaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/login.c7
-rw-r--r--loginutils/su.c7
-rw-r--r--loginutils/sulogin.c7
3 files changed, 13 insertions, 8 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index 5d50538..7f89075 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -432,7 +432,9 @@ int login_main(int argc, char **argv)
tmp = pw->pw_shell;
if (!tmp || !*tmp)
tmp = DEFAULT_SHELL;
+ /* setup_environment params: shell, loginshell, changeenv, pw */
setup_environment(tmp, 1, !(opt & LOGIN_OPT_p), pw);
+ /* FIXME: login shell = 1 -> 3rd parameter is ignored! */
motd();
@@ -463,7 +465,8 @@ int login_main(int argc, char **argv)
* should it leave SIGINT etc enabled or disabled? */
signal(SIGINT, SIG_DFL);
- run_shell(tmp, 1, 0, 0); /* exec the shell finally */
+ /* Exec login shell with no additional parameters */
+ run_shell(tmp, 1, NULL, NULL);
- return EXIT_FAILURE;
+ /* return EXIT_FAILURE; - not reached */
}
diff --git a/loginutils/su.c b/loginutils/su.c
index b4681fb..123907e 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -36,7 +36,7 @@ int su_main(int argc, char **argv)
/* get user if specified */
if (argc) {
opt_username = argv[0];
-// argc--;
+ //argc--; - not used below anyway
argv++;
}
@@ -86,18 +86,19 @@ int su_main(int argc, char **argv)
compromise the account by allowing access with a standard
shell. */
bb_error_msg("using restricted shell");
- opt_shell = 0;
+ opt_shell = NULL;
}
#endif
if (!opt_shell)
opt_shell = pw->pw_shell;
change_identity(pw);
+ /* setup_environment params: shell, loginshell, changeenv, pw */
setup_environment(opt_shell, flags & SU_OPT_l, !(flags & SU_OPT_mp), pw);
USE_SELINUX(set_current_security_context(NULL);)
/* Never returns */
run_shell(opt_shell, flags & SU_OPT_l, opt_command, (const char**)argv);
- return EXIT_FAILURE;
+ /* return EXIT_FAILURE; - not reached */
}
diff --git a/loginutils/sulogin.c b/loginutils/sulogin.c
index 5f0a408..5c73bda 100644
--- a/loginutils/sulogin.c
+++ b/loginutils/sulogin.c
@@ -112,14 +112,15 @@ int sulogin_main(int argc, char **argv)
USE_SELINUX(renew_current_security_context());
shell = getenv("SUSHELL");
- if (!shell) shell = getenv("sushell");
+ if (!shell)
+ shell = getenv("sushell");
if (!shell) {
shell = "/bin/sh";
if (pwd->pw_shell[0])
shell = pwd->pw_shell;
}
- run_shell(shell, 1, 0, 0);
- /* never returns */
+ /* Exec login shell with no additional parameters. Never returns. */
+ run_shell(shell, 1, NULL, NULL);
auth_error:
bb_error_msg_and_die("no password entry for 'root'");