summaryrefslogtreecommitdiff
path: root/session.c
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 /session.c
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@
Diffstat (limited to 'session.c')
-rw-r--r--session.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/session.c b/session.c
index 4448e6f1f..bced1f65a 100644
--- a/session.c
+++ b/session.c
@@ -1050,8 +1050,11 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
1050# endif /* HAVE_CYGWIN */ 1050# endif /* HAVE_CYGWIN */
1051#endif /* HAVE_LOGIN_CAP */ 1051#endif /* HAVE_LOGIN_CAP */
1052 1052
1053 snprintf(buf, sizeof buf, "%.200s/%.50s", _PATH_MAILDIR, pw->pw_name); 1053 if (!options.use_pam) {
1054 child_set_env(&env, &envsize, "MAIL", buf); 1054 snprintf(buf, sizeof buf, "%.200s/%.50s",
1055 _PATH_MAILDIR, pw->pw_name);
1056 child_set_env(&env, &envsize, "MAIL", buf);
1057 }
1055 1058
1056 /* Normal systems set SHELL by default. */ 1059 /* Normal systems set SHELL by default. */
1057 child_set_env(&env, &envsize, "SHELL", shell); 1060 child_set_env(&env, &envsize, "SHELL", shell);