]> granicus.if.org Git - sudo/commitdiff
Check KEPT_MAIL not DID_MAIL when determining whether to set MAIL
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 19 Jul 2010 16:12:03 +0000 (12:12 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 19 Jul 2010 16:12:03 +0000 (12:12 -0400)
in -i and env_reset mode.

--HG--
branch : 1.7

env.c

diff --git a/env.c b/env.c
index 84e2e74eac3b052160bd4067f58c7daf84559273..6ad32992f1e602a8451aa291dea6805246b459c8 100644 (file)
--- a/env.c
+++ b/env.c
@@ -700,7 +700,7 @@ rebuild_env(noexec)
         * Set MAIL to target user in -i mode or if MAIL is not preserved
         * from user's environment.
         */
-       if (ISSET(sudo_mode, MODE_LOGIN_SHELL) || !ISSET(didvar, DID_MAIL)) {
+       if (ISSET(sudo_mode, MODE_LOGIN_SHELL) || !ISSET(didvar, KEPT_MAIL)) {
            cp = _PATH_MAILDIR;
            if (cp[sizeof(_PATH_MAILDIR) - 2] == '/')
                easprintf(&cp, "MAIL=%s%s", _PATH_MAILDIR, runas_pw->pw_name);