From d162fcb550a77875c8f58fda0e0a0bd91f211c99 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 7 Dec 2006 00:26:24 +0100 Subject: Imported from util-linux-2.12j tarball. --- login-utils/login.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'login-utils/login.c') diff --git a/login-utils/login.c b/login-utils/login.c index 3b1bfa56e..666121240 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -1081,17 +1081,28 @@ Michael Riepe } if (!quietlog) { - struct stat st; - char *mail; - motd(); - mail = getenv("MAIL"); - if (mail && stat(mail, &st) == 0 && st.st_size != 0) { + +#ifdef DO_STAT_MAIL + /* + * This turns out to be a bad idea: when the mail spool + * is NFS mounted, and the NFS connection hangs, the + * login hangs, even root cannot login. + * Checking for mail should be done from the shell. + */ + { + struct stat st; + char *mail; + + mail = getenv("MAIL"); + if (mail && stat(mail, &st) == 0 && st.st_size != 0) { if (st.st_mtime > st.st_atime) printf(_("You have new mail.\n")); else printf(_("You have mail.\n")); + } } +#endif } signal(SIGALRM, SIG_DFL); -- cgit v1.2.3-55-g7522