git: f52bfdc1148d - stable/12 - ssh: remove duplicate setting of MAIL env var

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Tue, 26 Apr 2022 13:45:03 UTC
The branch stable/12 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=f52bfdc1148d12be09802a37e29e7cdba0b58699

commit f52bfdc1148d12be09802a37e29e7cdba0b58699
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-04-18 23:57:48 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2022-04-26 13:40:11 +0000

    ssh: remove duplicate setting of MAIL env var
    
    We already set it earlier in do_setup_env().
    
    Fixes:          19261079b743 ("openssh: update to OpenSSH v8.7p1")
    MFC after:      1 week
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 19780592633e50efca39454d1ecf029bd7d87868)
---
 crypto/openssh/session.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/crypto/openssh/session.c b/crypto/openssh/session.c
index 31d3bb932a50..7911ac98c786 100644
--- a/crypto/openssh/session.c
+++ b/crypto/openssh/session.c
@@ -1078,12 +1078,6 @@ do_setup_env(struct ssh *ssh, Session *s, const char *shell)
 # endif /* HAVE_CYGWIN */
 #endif /* HAVE_LOGIN_CAP */
 
-	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);