diff options
Diffstat (limited to 'contrib/sendmail/src/util.c')
-rw-r--r-- | contrib/sendmail/src/util.c | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/contrib/sendmail/src/util.c b/contrib/sendmail/src/util.c index af781ef..95d2f9a 100644 --- a/contrib/sendmail/src/util.c +++ b/contrib/sendmail/src/util.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998-2006 Sendmail, Inc. and its suppliers. + * Copyright (c) 1998-2007 Sendmail, Inc. and its suppliers. * All rights reserved. * Copyright (c) 1983, 1995-1997 Eric P. Allman. All rights reserved. * Copyright (c) 1988, 1993 @@ -13,7 +13,7 @@ #include <sendmail.h> -SM_RCSID("@(#)$Id: util.c,v 8.410 2006/12/18 18:36:44 ca Exp $") +SM_RCSID("@(#)$Id: util.c,v 8.413 2007/09/26 23:29:11 ca Exp $") #include <sm/sendmail.h> #include <sysexits.h> @@ -1154,7 +1154,8 @@ putxline(l, len, mci, pxflags) /* output last part */ if (l[0] == '.' && slop == 0 && - bitnset(M_XDOT, mci->mci_mailer->m_flags)) + bitnset(M_XDOT, mci->mci_mailer->m_flags) && + !bitset(MCIF_INLONGLINE, mci->mci_flags)) { if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT, '.') == SM_IO_EOF) @@ -1169,7 +1170,8 @@ putxline(l, len, mci, pxflags) else if (l[0] == 'F' && slop == 0 && bitset(PXLF_MAPFROM, pxflags) && strncmp(l, "From ", 5) == 0 && - bitnset(M_ESCFROM, mci->mci_mailer->m_flags)) + bitnset(M_ESCFROM, mci->mci_mailer->m_flags) && + !bitset(MCIF_INLONGLINE, mci->mci_flags)) { if (sm_io_putc(mci->mci_out, SM_TIME_DEFAULT, '>') == SM_IO_EOF) @@ -1188,13 +1190,19 @@ putxline(l, len, mci, pxflags) if (TrafficLogFile != NULL) (void) sm_io_putc(TrafficLogFile, SM_TIME_DEFAULT, '\n'); - if ((!bitset(PXLF_NOADDEOL, pxflags) || !noeol) && - sm_io_fputs(mci->mci_out, SM_TIME_DEFAULT, - mci->mci_mailer->m_eol) == SM_IO_EOF) + if ((!bitset(PXLF_NOADDEOL, pxflags) || !noeol)) { - dead = true; - break; + mci->mci_flags &= ~MCIF_INLONGLINE; + if (sm_io_fputs(mci->mci_out, SM_TIME_DEFAULT, + mci->mci_mailer->m_eol) == SM_IO_EOF) + { + dead = true; + break; + } } + else + mci->mci_flags |= MCIF_INLONGLINE; + if (l < end && *l == '\n') { if (*++l != ' ' && *l != '\t' && *l != '\0' && @@ -2813,7 +2821,14 @@ count_open_connections(hostaddr) if (hostaddr == NULL) return 0; - n = 0; + + /* + ** Initialize to 1 instead of 0 because this code gets called + ** before proc_list_add() gets called, so we (the daemon child + ** for this connection) don't count ourselves. + */ + + n = 1; for (i = 0; i < ProcListSize; i++) { if (ProcListVec[i].proc_pid == NO_PID) |