From 2ff2e19653b8c0798b8b8eff209651bdb1be2761 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Fri, 8 Feb 2019 14:53:35 +1100 Subject: don't set $MAIL if UsePam=yes PAM typically specifies the user environment if it's enabled, so don't second guess. bz#2937; ok dtucker@ --- session.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'session.c') diff --git a/session.c b/session.c index 4448e6f1..bced1f65 100644 --- a/session.c +++ b/session.c @@ -1050,8 +1050,11 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell) # endif /* HAVE_CYGWIN */ #endif /* HAVE_LOGIN_CAP */ - snprintf(buf, sizeof buf, "%.200s/%.50s", _PATH_MAILDIR, pw->pw_name); - child_set_env(&env, &envsize, "MAIL", buf); + if (!options.use_pam) { + snprintf(buf, sizeof buf, "%.200s/%.50s", + _PATH_MAILDIR, pw->pw_name); + child_set_env(&env, &envsize, "MAIL", buf); + } /* Normal systems set SHELL by default. */ child_set_env(&env, &envsize, "SHELL", shell); -- cgit v1.2.3