diff --git a/mail/milter-greylist/Makefile b/mail/milter-greylist/Makefile index 663f73c8edbb..a5c1a2ff6e60 100644 --- a/mail/milter-greylist/Makefile +++ b/mail/milter-greylist/Makefile @@ -1,46 +1,47 @@ # New ports collection makefile for: milter-greylist # Date created: 27 Apr 2004 # Whom: Cyril Guibourg # # $FreeBSD$ # PORTNAME= milter-greylist PORTVERSION= 1.2.2 +PORTREVISION= 1 CATEGORIES= mail MASTER_SITES= ftp://ftp.espci.fr/pub/milter-greylist/ EXTRACT_SUFX= .tgz MAINTAINER= aragorn+ports@teaser.fr COMMENT= Easy-to-use greylist milter for sendmail MAN5= greylist.conf.5 MAN8= milter-greylist.8 GNU_CONFIGURE= yes CONFIGURE_TARGET= --build=${MACHINE_ARCH}-portbld-freebsd${OSREL} CONFIGURE_ARGS+= --with-user=smmsp ALL_TARGET= milter-greylist USE_RC_SUBR= yes RC_SCRIPTS_SUB= PREFIX=${PREFIX} RC_SUBR=${RC_SUBR} post-extract: @${SED} ${RC_SCRIPTS_SUB:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \ ${FILESDIR}/milter-greylist.sh > ${WRKSRC}/milter-greylist.sh post-install: - ${MKDIR} /var/milter-greylist /var/db/milter-greylist - ${CHOWN} smmsp /var/milter-greylist /var/db/milter-greylist - ${MKDIR} ${PREFIX}/etc/rc.d - ${INSTALL_SCRIPT} ${WRKSRC}/milter-greylist.sh ${PREFIX}/etc/rc.d/ + @${MKDIR} /var/milter-greylist /var/db/milter-greylist + @${CHOWN} smmsp /var/milter-greylist /var/db/milter-greylist + @${MKDIR} ${PREFIX}/etc/rc.d + @${INSTALL_SCRIPT} ${WRKSRC}/milter-greylist.sh ${PREFIX}/etc/rc.d/ .if !defined(NOPORTDOCS) - ${MKDIR} ${DOCSDIR} - ${MKDIR} ${EXAMPLESDIR} - ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} - ${INSTALL_DATA} ${WRKSRC}/greylist.conf ${EXAMPLESDIR} + @${MKDIR} ${DOCSDIR} + @${MKDIR} ${EXAMPLESDIR} + @${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR} + @${INSTALL_DATA} ${WRKSRC}/greylist.conf ${EXAMPLESDIR} .endif @${CAT} ${PKGMESSAGE} .include diff --git a/mail/milter-greylist/files/patch-conf.c b/mail/milter-greylist/files/patch-conf.c new file mode 100644 index 000000000000..87658b336712 --- /dev/null +++ b/mail/milter-greylist/files/patch-conf.c @@ -0,0 +1,71 @@ +--- conf.c.orig Fri Apr 2 17:06:52 2004 ++++ conf.c Mon May 31 16:58:06 2004 +@@ -34,7 +34,7 @@ + #ifdef HAVE_SYS_CDEFS_H + #include + #ifdef __RCSID +-__RCSID("$Id: conf.c,v 1.15 2004/04/02 15:06:52 manu Exp $"); ++__RCSID("$Id: conf.c,v 1.15 (sigsev patch) 2004/04/02 15:06:52 manu Exp $"); + #endif + #endif + +@@ -83,6 +83,8 @@ + conf_load(void) /* exceptlist must be write-locked */ + { + FILE *stream; ++ pthread_t tid; ++ pthread_attr_t attr; + + /* + * Reset the configuration to its default +@@ -100,8 +102,49 @@ + return; + } + ++ /* ++ * On some platforms, the thread stack limit is too low and ++ * conf_parse will get a SIGSEGV because it overflows the ++ * stack. ++ * ++ * In order to fix this, we spawn a new thread just for ++ * parsing the config file, and we request a stack big ++ * enough to hold the parser data. 2 MB seems okay. ++ */ ++ + conf_in = stream; +- conf_parse(); ++ ++ if (pthread_attr_init(&attr) != 0) { ++ syslog(LOG_ERR, "pthread_attr_init failed: %s", ++ strerror(errno)); ++ exit(EX_OSERR); ++ } ++ ++ if (pthread_attr_setstacksize(&attr, 2 * 1024 * 1024) != 0) { ++ syslog(LOG_ERR, "pthread_attr_setstacksize failed: %s", ++ strerror(errno)); ++ exit(EX_OSERR); ++ } ++ ++ if (pthread_create(&tid, &attr, ++ (void *(*)(void *))conf_parse, NULL) != 0) { ++ syslog(LOG_ERR, "pthread_create failed: %s", ++ strerror(errno)); ++ exit(EX_OSERR); ++ } ++ ++ if (pthread_join(tid, NULL) != 0) { ++ syslog(LOG_ERR, "pthread_join failed: %s", ++ strerror(errno)); ++ exit(EX_OSERR); ++ } ++ ++ if (pthread_attr_destroy(&attr) != 0) { ++ syslog(LOG_ERR, "pthread_attr_destroy failed: %s", ++ strerror(errno)); ++ exit(EX_OSERR); ++ } ++ + fclose(stream); + + (void)gettimeofday(&conffile_modified, NULL);