diff options
author | Damien Miller <djm@mindrot.org> | 2019-02-08 14:53:35 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2019-02-08 14:53:35 +1100 |
commit | 2ff2e19653b8c0798b8b8eff209651bdb1be2761 (patch) | |
tree | 725790d2886b36a8c8b63f2f030776ab88793001 | |
parent | 03e92dd27d491fe6d1a54e7b2f44ef1b0a916e52 (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.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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); |