diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-04-07 19:20:48 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-04-07 19:20:48 +0000 |
commit | f11f4a7dbafbd6400a9fa3cdf96b7c9ea0864e22 (patch) | |
tree | b854afcecdc33fe5543f87e31ef21b3914546620 /gnu/usr.sbin/sendmail/libmilter | |
parent | 27b793c9bb279917ba44ac170eceefdb2dfad97a (diff) |
Update to sendmail-8.10.1
Diffstat (limited to 'gnu/usr.sbin/sendmail/libmilter')
-rw-r--r-- | gnu/usr.sbin/sendmail/libmilter/README | 24 | ||||
-rw-r--r-- | gnu/usr.sbin/sendmail/libmilter/engine.c | 14 |
2 files changed, 26 insertions, 12 deletions
diff --git a/gnu/usr.sbin/sendmail/libmilter/README b/gnu/usr.sbin/sendmail/libmilter/README index 48e32869b7f..621219fb044 100644 --- a/gnu/usr.sbin/sendmail/libmilter/README +++ b/gnu/usr.sbin/sendmail/libmilter/README @@ -9,6 +9,14 @@ through reference to a sample filter which is attached at the end of this file. It is necessary to first build libmilter.a, which can be done by issuing the './Build' command in SRCDIR/libmilter . +NOTE: Both libmilter and the callouts in sendmail are marked as an FFR (For +Future Release). If you intend to use them in 8.10.X, you must compiled +both libmilter and sendmail with -D_FFR_MILTER defined. You can do this by +adding the following to your devtools/Site/site.config.m4 file: + + dnl Milter + APPENDDEF(`conf_sendmail_ENVDEF', `-D_FFR_MILTER=1') + APPENDDEF(`conf_libmilter_ENVDEF', `-D_FFR_MILTER=1') +-------------------+ | BUILDING A FILTER | @@ -18,11 +26,13 @@ The following command presumes that the sample code from the end of this README is saved to a file named 'sample.c' and built in the local platform- specific build subdirectory (SRCDIR/obj.*/libmilter). - cc -I../../sendmail -I../../include -o sample sample.c -L. -lmilter -pthread + cc -I../../sendmail -I../../include -o sample sample.c libmilter.a ../libsmutil/libsmutil.a -pthread It is recommended that you build your filters in a location outside of the sendmail source tree. Modify the compiler include references (-I) -and linker library locations (-L) accordingly. +and the library locations accordingly. Also, some operating systems may +require additional libraries. For example, SunOS 5.X requires '-lresolv +-lsocket -lnsl'. Filters must be thread-safe! Many operating systems now provide support for POSIX threads in the standard C libraries. The compiler flag to link with @@ -174,7 +184,7 @@ extern sfsistat mlfi_cleanup(SMFICTX *, bool); sfsistat mlfi_envfrom(ctx, envfrom) SMFICTX *ctx; - char *envfrom; + char **envfrom; { struct mlfiPriv *priv; int fd; @@ -214,10 +224,10 @@ sfsistat mlfi_header(ctx, headerf, headerv) SMFICTX *ctx; char *headerf; - u_char *headerv; + char *headerv; { /* write the header to the log file */ - fprintf(MLFIPRIV->mlfi_fp, "%s: %s\n", headerf, headerv); + fprintf(MLFIPRIV->mlfi_fp, "%s: %s\r\n", headerf, headerv); /* continue processing */ return SMFIS_CONTINUE; @@ -228,7 +238,7 @@ mlfi_eoh(ctx) SMFICTX *ctx; { /* output the blank line between the header and the body */ - fprintf(MLFIPRIV->mlfi_fp, "\n"); + fprintf(MLFIPRIV->mlfi_fp, "\r\n"); /* continue processing */ return SMFIS_CONTINUE; @@ -375,4 +385,4 @@ main(argc, argv) /* eof */ -$Revision: 1.2 $, Last updated $Date: 2000/04/02 19:48:31 $ +$Revision: 1.3 $, Last updated $Date: 2000/04/07 19:20:34 $ diff --git a/gnu/usr.sbin/sendmail/libmilter/engine.c b/gnu/usr.sbin/sendmail/libmilter/engine.c index ffad361f7ab..e0f4b378270 100644 --- a/gnu/usr.sbin/sendmail/libmilter/engine.c +++ b/gnu/usr.sbin/sendmail/libmilter/engine.c @@ -9,7 +9,7 @@ */ #ifndef lint -static char id[] = "@(#)$Sendmail: engine.c,v 8.65 2000/02/17 17:52:14 ca Exp $"; +static char id[] = "@(#)$Sendmail: engine.c,v 8.67 2000/03/27 05:04:16 ca Exp $"; #endif /* ! lint */ #if _FFR_MILTER @@ -384,7 +384,8 @@ sendreply(r, fd, timeout_ptr, ctx) if (ctx->ctx_reply != NULL) { ret = mi_wr_cmd(fd, timeout_ptr, SMFIR_REPLYCODE, - ctx->ctx_reply, strlen(ctx->ctx_reply)); + ctx->ctx_reply, + strlen(ctx->ctx_reply) + 1); free(ctx->ctx_reply); ctx->ctx_reply = NULL; } @@ -537,14 +538,17 @@ st_connectinfo(g) ++i; if (i >= l) return _SMFIS_ABORT; - family = s[++i]; + + /* Move past trailing \0 in host string */ + i++; + family = s[i++]; memset(&sockaddr, '\0', sizeof sockaddr); if (family != SMFIA_UNKNOWN) { (void) memcpy((void *) &port, (void *) (s + i), sizeof port); port = ntohs(port); - if ((i += 2) >= l) + if ((i += sizeof port) >= l) { smi_log(SMI_LOG_ERR, "%s: connect[%d]: wrong len %d >= %d", @@ -555,7 +559,7 @@ st_connectinfo(g) # if NETINET if (family == SMFIA_INET) { - if (inet_aton(s + i, (struct in_addr *) &sockaddr) + if (inet_aton(s + i, (struct in_addr *) &sockaddr.sin.sin_addr) == INADDR_NONE) { smi_log(SMI_LOG_ERR, |