aboutsummaryrefslogtreecommitdiff
path: root/loginutils/su.c
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils/su.c')
-rw-r--r--loginutils/su.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/loginutils/su.c b/loginutils/su.c
index 57ea738f4..2ec05e125 100644
--- a/loginutils/su.c
+++ b/loginutils/su.c
@@ -131,7 +131,8 @@ 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_mp) * SETUP_ENV_CHANGEENV)
+ + (!(flags & SU_OPT_l) * SETUP_ENV_NO_CHDIR),
pw);
IF_SELINUX(set_current_security_context(NULL);)