summaryrefslogtreecommitdiff
path: root/gnu/usr.sbin/sendmail/libmilter
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-09-18 04:08:36 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-09-18 04:08:36 +0000
commitf06c374d9ebfc93d41741cdb71cc8279b64c59b0 (patch)
treebc964fe6a044562cdc9afc917b647531dd6f2d04 /gnu/usr.sbin/sendmail/libmilter
parent8665b934035fc50517e659380c682e6e04582855 (diff)
Update to sendmail-8.13.1
Diffstat (limited to 'gnu/usr.sbin/sendmail/libmilter')
-rw-r--r--gnu/usr.sbin/sendmail/libmilter/comm.c31
1 files changed, 28 insertions, 3 deletions
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/gen.h>
-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 <sm/errstring.h>
#include <sys/uio.h>
+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 */