summaryrefslogtreecommitdiff
path: root/loginutils/su.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-09-10 13:15:28 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-09-10 13:15:28 +0000
commita2f61012b6f93473ed002e6609557cb1cd81b7dd (patch)
tree51ce422afbda2249a5de22e834ed04e200e0961f /loginutils/su.c
parentac074b3f87cc22c2ddadb074d630156fea720744 (diff)
downloadbusybox-a2f61012b6f93473ed002e6609557cb1cd81b7dd.tar.gz
setup_environment: code shrink
run_shell: mark as NORETURN setup_environment, run_shell: add usage comments login: add FIXME :( function old new delta UNSPEC_print 64 66 +2 sulogin_main 509 506 -3 mkfs_minix_main 3070 3067 -3 login_main 1615 1612 -3 su_main 461 448 -13 setup_environment 261 206 -55 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/5 up/down: 2/-77) Total: -75 bytes text data bss dec hex filename 772578 1051 10724 784353 bf7e1 busybox_old 772502 1051 10724 784277 bf795 busybox_unstripped
Diffstat (limited to 'loginutils/su.c')
-rw-r--r--loginutils/su.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/loginutils/su.c b/loginutils/su.c
index b4681fb6a..123907e28 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 */
}