diff --git a/mail/mlmmj/Makefile b/mail/mlmmj/Makefile index 8d75ef9c50dd..b8b31051d641 100644 --- a/mail/mlmmj/Makefile +++ b/mail/mlmmj/Makefile @@ -1,50 +1,50 @@ # Created by: Christian Laursen PORTNAME= mlmmj PORTVERSION= 1.3.0 -PORTREVISION= 8 +PORTREVISION= 9 CATEGORIES= mail MASTER_SITES= http://mlmmj.org/releases/ MAINTAINER= bapt@FreeBSD.org COMMENT= Simple and slim mailing list manager LICENSE= MIT LICENSE_FILE= ${WRKSRC}/LICENSE USES= cpe gmake iconv shebangfix tar:bzip2 SHEBANG_FILES= contrib/web/perl-user/mlmmj.cgi GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-receive-strip CPPFLAGS+= -I${ICONV_INCLUDE_PATH} LDFLAGS+= ${ICONV_LIB_PATH} OPTIONS_DEFINE= DOCS PERL PHP OPTIONS_SUB= yes PERL_RUN_DEPENDS= p5-URI>0:net/p5-URI \ p5-CGI-FastTemplate>0:www/p5-CGI-FastTemplate \ p5-HTML-Parser>0:www/p5-HTML-Parser PHP_USES= php:web post-patch: @${REINPLACE_CMD} -e \ '/^AM_CFLAGS/s|-g ||' ${WRKSRC}/src/Makefile.in post-install-DOCS-on: @${MKDIR} ${STAGEDIR}${DOCSDIR} (cd ${WRKSRC} && ${INSTALL_DATA} \ ChangeLog FAQ README* TODO TUNABLES UPGRADE \ ${STAGEDIR}${DOCSDIR}) post-install-PERL-on: @(cd ${WRKSRC}/contrib/web && ${COPYTREE_SHARE} "perl-*" \ ${STAGEDIR}${WWWDIR}) @${CHMOD} ${BINMODE} ${STAGEDIR}${WWWDIR}/perl-user/mlmmj.cgi post-install-PHP-on: @(cd ${WRKSRC}/contrib/web && ${COPYTREE_SHARE} "php-*" \ ${STAGEDIR}${WWWDIR}) .include diff --git a/mail/mlmmj/files/patch-src_init__sockfd.c b/mail/mlmmj/files/patch-src_init__sockfd.c new file mode 100644 index 000000000000..5eb98647a35d --- /dev/null +++ b/mail/mlmmj/files/patch-src_init__sockfd.c @@ -0,0 +1,74 @@ +--- src/init_sockfd.c.orig 2012-03-13 12:16:36 UTC ++++ src/init_sockfd.c +@@ -22,6 +22,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -29,35 +30,53 @@ + #include + #include + #include ++#include + + #include "init_sockfd.h" + #include "log_error.h" + + void init_sockfd(int *sockfd, const char *relayhost, unsigned short port) + { +- int len, on; +- struct sockaddr_in addr; ++ int on, sd; ++ struct addrinfo *ai = NULL, *curai, hints; ++ char srv[NI_MAXSERV]; ++ *sockfd = -1; + + if (getenv("MLMMJ_TESTING")) { + relayhost = "127.0.0.1"; + port = 10025; + } + +- *sockfd = socket(PF_INET, SOCK_STREAM, 0); ++ memset(&hints, 0, sizeof(hints)); ++ hints.ai_socktype = SOCK_STREAM; ++ hints.ai_family = PF_UNSPEC; ++ snprintf(srv, sizeof(srv), "%d", port); ++ if (getaddrinfo(relayhost, srv, &hints, &ai) != 0) { ++ log_error(LOG_ARGS, "Unable to lookup for relayhost %s:%s", ++ relayhost, srv); ++ return; ++ } + if(*sockfd == -1) { + log_error(LOG_ARGS, "Could not get socket"); + return; + } +- addr.sin_family = PF_INET; +- addr.sin_addr.s_addr = inet_addr(relayhost); +- addr.sin_port = htons(port); +- len = sizeof(addr); +- if(connect(*sockfd, (struct sockaddr *)&addr, len) == -1) { ++ for (curai = ai; curai != NULL; curai = curai->ai_next) { ++ if ((sd = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol)) < 0) { ++ continue; ++ } ++ if (connect(sd, ai->ai_addr, ai->ai_addrlen) == 0) { ++ close(sd); ++ sd = -1; ++ continue; ++ } ++ break; ++ } ++ freeaddrinfo(ai); ++ if (sd == -1) { + log_error(LOG_ARGS, "Could not connect to %s", relayhost); +- close(*sockfd); +- *sockfd = -1; + return; + } ++ *sockfd = sd; + + on = 1; + if(setsockopt(*sockfd, SOL_SOCKET, SO_KEEPALIVE, (void *)&on,