summaryrefslogtreecommitdiff
path: root/loginutils/su.c
diff options
context:
space:
mode:
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)
change_identity(pw);
setup_environment(opt_shell,
- ((flags & SU_OPT_l) / SU_OPT_l * SETUP_ENV_CLEARENV)
- + (!(flags & SU_OPT_mp) * SETUP_ENV_CHANGEENV)
- + (!(flags & SU_OPT_l) * SETUP_ENV_NO_CHDIR),
- pw);
+ ((flags & SU_OPT_l) ? (SETUP_ENV_CLEARENV + SETUP_ENV_CHDIR) : 0)
+ + (!(flags & SU_OPT_mp) * SETUP_ENV_CHANGEENV),
+ pw);
IF_SELINUX(set_current_security_context(NULL);)
if (opt_command) {