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@
This commit is contained in:
Damien Miller 2019-02-08 14:53:35 +11:00
parent 03e92dd27d
commit 2ff2e19653

View File

@ -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);