From c3a31dcb427164135c922ef29404c31d7e876904 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 10 Oct 2003 20:55:21 +0000 Subject: [PATCH] Bulletproof the dup killer. svn path=/trunk/; revision=3856 --- transact.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/transact.c b/transact.c index 843dd7ee..2bb28ede 100644 --- a/transact.c +++ b/transact.c @@ -899,10 +899,7 @@ int readheaders(int sock, * get N copies. This is bad when N > 1. * * Foil this by suppressing all but one copy of a message with a - * given set of headers. The accept_count test ensures - * that multiple pieces of email with the same Message-ID, each - * with a *single* addressee (the N == 1 case), won't be - * suppressed. + * given set of headers. * * Note: This implementation only catches runs of successive * messages with the same ID, but that should be good @@ -930,11 +927,10 @@ int readheaders(int sock, * If so there is a one in 18-quadrillion chance this * code will incorrectly nuke the first message. */ - if (memcmp(ctl->lastdigest, ctl->digest, DIGESTLEN)) - memcpy(ctl->lastdigest, ctl->digest, DIGESTLEN); - else if (accept_count > 1) + if (!memcmp(ctl->lastdigest, ctl->digest, DIGESTLEN)) return(PS_REFUSED); } + memcpy(ctl->lastdigest, ctl->digest, DIGESTLEN); } /* -- 2.43.2