mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-28 08:02:54 +00:00
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.
This commit is contained in:
parent
b721f69c14
commit
0e80e8b216
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=86450
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user