summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2019-02-08 14:53:35 +1100
committerDamien Miller <djm@mindrot.org>2019-02-08 14:53:35 +1100
commit2ff2e19653b8c0798b8b8eff209651bdb1be2761 (patch)
tree725790d2886b36a8c8b63f2f030776ab88793001
parent03e92dd27d491fe6d1a54e7b2f44ef1b0a916e52 (diff)
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@
-rw-r--r--session.c7
1 files changed, 5 insertions, 2 deletions
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);