aboutsummaryrefslogtreecommitdiff
path: root/loginutils/su.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2022-01-13 12:50:48 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2022-01-13 12:50:48 +0100
commit931c55f9e2b41473132683488820c6fb7c47506b (patch)
tree56cbfd7e7b1d85998192e5b61c132b9d4a465b8b /loginutils/su.c
parentb3eec1651fb02d70716caa355f49320719f74c75 (diff)
downloadbusybox-w32-931c55f9e2b41473132683488820c6fb7c47506b.tar.gz
busybox-w32-931c55f9e2b41473132683488820c6fb7c47506b.tar.bz2
busybox-w32-931c55f9e2b41473132683488820c6fb7c47506b.zip
libbb: invert the meaning of SETUP_ENV_NO_CHDIR -> SETUP_ENV_CHDIR
Double negatives are hard to grok. function old new delta login_main 986 988 +2 su_main 474 470 -4 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 1/1 up/down: 2/-4) Total: -2 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils/su.c')
-rw-r--r--loginutils/su.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/loginutils/su.c b/loginutils/su.c
index e1db7590f..6efe1981a 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -176,10 +176,9 @@ int su_main(int argc UNUSED_PARAM, char **argv)
176 176
177 change_identity(pw); 177 change_identity(pw);
178 setup_environment(opt_shell, 178 setup_environment(opt_shell,
179 ((flags & SU_OPT_l) / SU_OPT_l * SETUP_ENV_CLEARENV) 179 ((flags & SU_OPT_l) ? (SETUP_ENV_CLEARENV + SETUP_ENV_CHDIR) : 0)
180 + (!(flags & SU_OPT_mp) * SETUP_ENV_CHANGEENV) 180 + (!(flags & SU_OPT_mp) * SETUP_ENV_CHANGEENV),
181 + (!(flags & SU_OPT_l) * SETUP_ENV_NO_CHDIR), 181 pw);
182 pw);
183 IF_SELINUX(set_current_security_context(NULL);) 182 IF_SELINUX(set_current_security_context(NULL);)
184 183
185 if (opt_command) { 184 if (opt_command) {