FreeBSD Bugzilla – Attachment 202938 Details for
Bug 236605
mail/sendmail: additional blacklisting for frequent useless connections [patch]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
patch
patch-no-command.diff (text/plain), 1.57 KB, created by
Helge Oldach
on 2019-03-17 17:13:17 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Helge Oldach
Created:
2019-03-17 17:13:17 UTC
Size:
1.57 KB
patch
obsolete
>Blacklist in case no command issued or the connection was terminated. >NB: we need to dup the input file descriptor for later use by the actual >blacklist() call as the original fd might already have been closed and >we cannot retrieve the sockaddr info from it any longer. >hmo17mar19 > >--- sendmail/srvrsmtp.c.orig 2019-03-17 16:37:45.036254000 +0100 >+++ sendmail/srvrsmtp.c 2019-03-17 17:01:28.485985000 +0100 >@@ -831,6 +831,9 @@ > #if _FFR_BADRCPT_SHUTDOWN > int n_badrcpts_adj; > #endif /* _FFR_BADRCPT_SHUTDOWN */ >+#ifdef USE_BLACKLIST >+ int saved_bl_fd; >+#endif > > SevenBitInput_Saved = SevenBitInput; > smtp.sm_nrcpts = 0; >@@ -1422,6 +1425,10 @@ > SmtpPhase = "server cmd read"; > sm_setproctitle(true, e, "server %s cmd read", CurSmtpClient); > >+#ifdef USE_BLACKLIST >+ saved_bl_fd = dup(sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL)); >+#endif >+ > /* handle errors */ > if (sm_io_error(OutChannel) || > (p = sfgets(inp, sizeof(inp), InChannel, >@@ -3469,10 +3476,17 @@ > ** timeouts for the same connection. > */ > >+#ifdef USE_BLACKLIST >+ /* no immediate BLACKLIST_ABUSIVE_BEHAVIOR */ >+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, saved_bl_fd, "no command issued"); >+#endif > sm_syslog(LOG_INFO, e->e_id, > "%s did not issue MAIL/EXPN/VRFY/ETRN during connection to %s", > CurSmtpClient, d); > } >+#ifdef USE_BLACKLIST >+ close(saved_bl_fd); >+#endif > if (tTd(93, 100)) > { > /* return to handle next connection */ >@@ -3585,6 +3599,9 @@ > #if SASL > } > #endif /* SASL */ >+#ifdef USE_BLACKLIST >+ close(saved_bl_fd); >+#endif > } > SM_EXCEPT(exc, "[!F]*") > {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 236605
: 202938