From f06c374d9ebfc93d41741cdb71cc8279b64c59b0 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sat, 18 Sep 2004 04:08:36 +0000 Subject: Update to sendmail-8.13.1 --- gnu/usr.sbin/sendmail/libmilter/comm.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) (limited to 'gnu/usr.sbin/sendmail/libmilter') diff --git a/gnu/usr.sbin/sendmail/libmilter/comm.c b/gnu/usr.sbin/sendmail/libmilter/comm.c index 9b0a6798e87..55124a897a2 100644 --- a/gnu/usr.sbin/sendmail/libmilter/comm.c +++ b/gnu/usr.sbin/sendmail/libmilter/comm.c @@ -9,12 +9,37 @@ */ #include -SM_RCSID("@(#)$Sendmail: comm.c,v 8.64 2004/04/30 22:02:57 ca Exp $") +SM_RCSID("@(#)$Sendmail: comm.c,v 8.65 2004/07/07 21:41:30 ca Exp $") #include "libmilter.h" #include #include +static size_t Maxdatasize = MILTER_MAX_DATA_SIZE; + +#if _FFR_MAXDATASIZE +/* +** SMFI_SETMAXDATASIZE -- set limit for milter data read/write. +** +** Parameters: +** sz -- new limit. +** +** Returns: +** old limit +*/ + +size_t +smfi_setmaxdatasize(sz) + size_t sz; +{ + size_t old; + + old = Maxdatasize; + Maxdatasize = sz; + return old; +} +#endif /* _FFR_MAXDATASIZE */ + /* ** MI_RD_CMD -- read a command ** @@ -108,7 +133,7 @@ mi_rd_cmd(sd, timeout, cmd, rlen, name) expl = ntohl(expl) - 1; if (expl <= 0) return NULL; - if (expl > MILTER_CHUNK_SIZE) + if (expl > Maxdatasize) { *cmd = SMFIC_TOOBIG; return NULL; @@ -307,7 +332,7 @@ mi_wr_cmd(sd, timeout, cmd, buf, len) struct iovec iov[2]; char data[MILTER_LEN_BYTES + 1]; - if (len > MILTER_CHUNK_SIZE || (len > 0 && buf == NULL)) + if (len > Maxdatasize || (len > 0 && buf == NULL)) return MI_FAILURE; nl = htonl(len + 1); /* add 1 for the cmd char */ -- cgit v1.2.3