diff options
Diffstat (limited to 'loginutils/su.c')
-rw-r--r-- | loginutils/su.c | 7 |
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) | |||
36 | /* get user if specified */ | 36 | /* get user if specified */ |
37 | if (argc) { | 37 | if (argc) { |
38 | opt_username = argv[0]; | 38 | opt_username = argv[0]; |
39 | // argc--; | 39 | //argc--; - not used below anyway |
40 | argv++; | 40 | argv++; |
41 | } | 41 | } |
42 | 42 | ||
@@ -86,18 +86,19 @@ int su_main(int argc, char **argv) | |||
86 | compromise the account by allowing access with a standard | 86 | compromise the account by allowing access with a standard |
87 | shell. */ | 87 | shell. */ |
88 | bb_error_msg("using restricted shell"); | 88 | bb_error_msg("using restricted shell"); |
89 | opt_shell = 0; | 89 | opt_shell = NULL; |
90 | } | 90 | } |
91 | #endif | 91 | #endif |
92 | if (!opt_shell) | 92 | if (!opt_shell) |
93 | opt_shell = pw->pw_shell; | 93 | opt_shell = pw->pw_shell; |
94 | 94 | ||
95 | change_identity(pw); | 95 | change_identity(pw); |
96 | /* setup_environment params: shell, loginshell, changeenv, pw */ | ||
96 | setup_environment(opt_shell, flags & SU_OPT_l, !(flags & SU_OPT_mp), pw); | 97 | setup_environment(opt_shell, flags & SU_OPT_l, !(flags & SU_OPT_mp), pw); |
97 | USE_SELINUX(set_current_security_context(NULL);) | 98 | USE_SELINUX(set_current_security_context(NULL);) |
98 | 99 | ||
99 | /* Never returns */ | 100 | /* Never returns */ |
100 | run_shell(opt_shell, flags & SU_OPT_l, opt_command, (const char**)argv); | 101 | run_shell(opt_shell, flags & SU_OPT_l, opt_command, (const char**)argv); |
101 | 102 | ||
102 | return EXIT_FAILURE; | 103 | /* return EXIT_FAILURE; - not reached */ |
103 | } | 104 | } |