diff options
author | rwatson <rwatson@FreeBSD.org> | 2001-11-16 04:39:16 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2001-11-16 04:39:16 +0000 |
commit | 0922d9a44c3dacf6572d43537e08e557c7ae2b70 (patch) | |
tree | 46d10be0e5532cf9c768430f78c7c7b6cc011761 /usr.bin/login/login.c | |
parent | 5f3369bd0eba39628b3ff57e3f632070581b48a5 (diff) | |
download | FreeBSD-src-0922d9a44c3dacf6572d43537e08e557c7ae2b70.zip FreeBSD-src-0922d9a44c3dacf6572d43537e08e557c7ae2b70.tar.gz |
o Add support for a 'nocheckmail' capability, which (if true) prevents
the 'You have mail.' check. This is useful for sites that rely on
remote mail access, rather than a local mail spool. Due to the
behavior of login_getcapbool(), the negated form is required so as
to have appropriate results.
o This behavior may have to be independently added to sshd due to
redundant implementation.
Diffstat (limited to 'usr.bin/login/login.c')
-rw-r--r-- | usr.bin/login/login.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 93c745f..127467d 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -661,15 +661,18 @@ main(argc, argv) cw = _PATH_MOTDFILE; motd(cw); - cw = getenv("MAIL"); /* $MAIL may have been set by class */ - if (cw != NULL) - strlcpy(tbuf, cw, sizeof(tbuf)); - else - snprintf(tbuf, sizeof(tbuf), "%s/%s", _PATH_MAILDIR, - pwd->pw_name); - if (stat(tbuf, &st) == 0 && st.st_size != 0) - (void)printf("You have %smail.\n", - (st.st_mtime > st.st_atime) ? "new " : ""); + if (login_getcapbool(lc, "nocheckmail", 0) == 0) { + /* $MAIL may have been set by class. */ + cw = getenv("MAIL"); + if (cw != NULL) + strlcpy(tbuf, cw, sizeof(tbuf)); + else + snprintf(tbuf, sizeof(tbuf), "%s/%s", + _PATH_MAILDIR, pwd->pw_name); + if (stat(tbuf, &st) == 0 && st.st_size != 0) + (void)printf("You have %smail.\n", + (st.st_mtime > st.st_atime) ? "new " : ""); + } } login_close(lc); |