diff --git a/mail/opendkim-devel/Makefile b/mail/opendkim-devel/Makefile index 338b4141d3d1..9053f3e023aa 100644 --- a/mail/opendkim-devel/Makefile +++ b/mail/opendkim-devel/Makefile @@ -1,229 +1,230 @@ PORTNAME= opendkim DISTVERSIONPREFIX= rel-opendkim- DISTVERSION= 2.11.0-Beta2-48 DISTVERSIONSUFFIX= -g551ab382 +PORTREVISION= 1 CATEGORIES= mail security PKGNAMESUFFIX= -devel MAINTAINER= yasu@FreeBSD.org COMMENT= DKIM library and milter implementation WWW= http://opendkim.org/ LICENSE= BSD3CLAUSE SENDMAIL LICENSE_COMB= multi LICENSE_GROUPS_SENDMAIL= FSF OSI LICENSE_NAME_SENDMAIL= Sendmail Open Source License LICENSE_FILE_SENDMAIL= ${WRKSRC}/LICENSE.Sendmail LICENSE_PERMS_SENDMAIL= dist-mirror dist-sell pkg-mirror pkg-sell \ auto-accept USES= autoreconf cpe libtool perl5 pkgconfig shebangfix ssl USE_GITHUB= yes GH_ACCOUNT= trusteddomainproject GH_PROJECT= OpenDKIM USE_LDCONFIG= yes USE_PERL5= run SHEBANG_FILES= opendkim/opendkim-genkey* reprrd/opendkim-reprrdimport* \ reputation/opendkim-* stats/opendkim-* GNU_CONFIGURE= yes MAKE_ARGS= pkgconfigdir="${PREFIX}/libdata/pkgconfig" MAKE_ENV= INSTALL_STRIP_FLAG=${STRIP} TEST_TARGET= check CONFLICTS_INSTALL= opendkim PORTDOCS= * OPTIONS_DEFINE= BDB_BASE CURL DOCS FILTER GNUTLS JANSSON LDNS \ LMDB LUA MEMCACHED OPENDBX OPENLDAP POPAUTH \ QUERY_CACHE SASL OPTIONS_DEFAULT= FILTER LUA UNBOUND OPTIONS_GROUP= DEVELOPER FFR OPTIONS_GROUP_DEVELOPER= ALLSYMBOLS CODECOVERAGE DEBUG OPTIONS_GROUP_FFR= ADSP_LISTS ATPS DB_HANDLE_POOLS DEFAULT_SENDER \ DIFFHEADERS IDENTITY_HEADER LDAP_CACHING \ LUA_ONLY_SIGNING POSTGRES_RECONNECT_HACK \ RATE_LIMIT RBL REPLACE_RULES REPRRD REPUTATION \ RESIGN SENDER_MACRO SOCKETDB STATS STATSEXT VBR OPTIONS_SINGLE= RESOLV OPTIONS_SINGLE_RESOLV= STOCK_RESOLVER UNBOUND NO_OPTIONS_SORT= yes OPTIONS_SUB= yes ADSP_LISTS_DESC= ADSP filtering for lists (experimental) ALLSYMBOLS_DESC= Export all internal symbols for better test coverage ATPS_DESC= Authorized Third Party Sign check BDB_BASE_DESC= Use Berkeley DB from base CODECOVERAGE_DESC= Enable internal code-coverage/profiling CURL_DESC= Use cURL for web queries DB_HANDLE_POOLS_DESC= Database handle pools (experimental) DEBUG_DESC= Build with debug symbols DEFAULT_SENDER_DESC= Default sender address DEVELOPER_DESC= Options useful for OpenDKIM development DIFFHEADERS_DESC= Compare signed and verified headers (experimental) FFR_DESC= Use features marked as For-Future-Releases FILTER_DESC= OpenDKIM filter, requires libmilter/Sendmail GNUTLS_DESC= Use GnuTLS instead of OpenSSL IDENTITY_HEADER_DESC= Special header to set identity JANSSON_DESC= Statistics and other output as JSON data LDAP_CACHING_DESC= LDAP query piggybacking and caching LDNS_DESC= Use LDNS library for DNS queries LMDB_DESC= Use Lightning Memory-Mapped DB key-value store LUA_DESC= Describe filter policy with lua LUA_ONLY_SIGNING_DESC= Message signing by Lua only MEMCACHED_DESC= Use memcached as a data set OPENDBX_DESC= Store filter policies via OpenDBX OPENLDAP_DESC= Store filter policies in LDAP POPAUTH_DESC= Use POP authentication DB POSTGRES_RECONNECT_HACK_DESC= PostgreSQL connection error detection bug hack QUERY_CACHE_DESC= Cache DNS query results locally RATE_LIMIT_DESC= DKIM based rate limiting support RBL_DESC= Realtime Blacklist query support REPLACE_RULES_DESC= String substition when signing REPRRD_DESC= Support for collaborative reputation that uses rrdtool (experimental) REPUTATION_DESC= Reputation check (experimental) RESIGN_DESC= One-step resigning SASL_DESC= Enable SASL authentication with LDAP SENDER_MACRO_DESC= Macro to determine sender SOCKETDB_DESC= Arbitrary socket data sets STATSEXT_DESC= Localized stats extensions STATS_DESC= Per-message and per-signature statistics STOCK_RESOLVER_DESC= Use the stock resolver library UNBOUND_DESC= Use unbound DNS library VBR_DESC= Vouch-By-Reference support ADSP_LISTS_CONFIGURE_ENABLE= adsp_lists ALLSYMBOLS_CONFIGURE_ENABLE= allsymbols ATPS_CONFIGURE_ENABLE= atps CODECOVERAGE_CONFIGURE_ENABLE= codecoverage CURL_LIB_DEPENDS= libcurl.so:ftp/curl CURL_CONFIGURE_WITH= libcurl DB_HANDLE_POOLS_CONFIGURE_ENABLE= db_handle_pools DEBUG_CONFIGURE_ENABLE= debug DEFAULT_SENDER_CONFIGURE_ENABLE= default_sender DIFFHEADERS_LIB_DEPENDS= libtre.so:textproc/libtre DIFFHEADERS_CONFIGURE_ENABLE= diffheaders DIFFHEADERS_CONFIGURE_WITH= tre=${LOCALBASE} FILTER_USE= RC_SUBR=milter-opendkim GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls GNUTLS_CONFIGURE_OFF= --with-openssl=${OPENSSLBASE} GNUTLS_CONFIGURE_WITH= gnutls IDENTITY_HEADER_CONFIGURE_ENABLE= identity_header JANSSON_LIB_DEPENDS= libjansson.so:devel/jansson JANSSON_CONFIGURE_WITH= libjansson LDAP_CACHING_USES= ldap LDAP_CACHING_CONFIGURE_ENABLE= ldap_caching LDNS_LIB_DEPENDS= libldns.so:dns/ldns LDNS_CONFIGURE_WITH= ldns LMDB_LIB_DEPENDS= liblmdb.so:databases/lmdb LMDB_CONFIGURE_WITH= lmdb LUA_USES= lua LUA_CONFIGURE_WITH= lua LUA_ONLY_SIGNING_IMPLIES= LUA LUA_ONLY_SIGNING_CONFIGURE_ENABLE= lua_only_signing MEMCACHED_LIB_DEPENDS= libmemcached.so:databases/libmemcached MEMCACHED_CONFIGURE_WITH= libmemcached OPENDBX_LIB_DEPENDS= libopendbx.so:databases/opendbx OPENDBX_CONFIGURE_WITH= odbx OPENLDAP_USES= ldap OPENLDAP_CONFIGURE_WITH= openldap POPAUTH_CONFIGURE_ENABLE= popauth POSTGRES_RECONNECT_HACK_CONFIGURE_ENABLE= postgresql_reconnect_hack QUERY_CACHE_CONFIGURE_ENABLE= query_cache RATE_LIMIT_CONFIGURE_ENABLE= rate_limit RBL_IMPLIES= LUA RBL_CONFIGURE_ENABLE= rbl REPLACE_RULES_CONFIGURE_ENABLE= replace_rules REPRRD_LIB_DEPENDS= librrd.so:databases/rrdtool REPRRD_CONFIGURE_ENABLE= reprrd REPUTATION_IMPLIES= CURL JANSSON REPUTATION_CONFIGURE_ENABLE= reputation RESIGN_CONFIGURE_ENABLE= resign SASL_IMPLIES= OPENLDAP SASL_CONFIGURE_WITH= sasl SENDER_MACRO_CONFIGURE_ENABLE= sender_macro SOCKETDB_CONFIGURE_ENABLE= socketdb STATSEXT_IMPLIES= LUA STATS STATSEXT_CONFIGURE_ENABLE= statsext STATS_CONFIGURE_ENABLE= stats UNBOUND_LIB_DEPENDS= libunbound.so:dns/unbound UNBOUND_CONFIGURE_WITH= unbound VBR_CONFIGURE_ENABLE= vbr .include .if ${PORT_OPTIONS:MFILTER} SUB_FILES= pkg-message WITHOUT_MILTER_CFLAGS= yes WITHOUT_MILTER_LDFLAGS= yes .include "${PORTSDIR}/mail/sendmail/bsd.milter.mk" CONFIGURE_ARGS+= --with-milter=${MILTERBASE} .endif .if ${PORT_OPTIONS:MPOPAUTH} || ${PORT_OPTIONS:MQUERY_CACHE} || \ ${PORT_OPTIONS:MLDAP_CACHING} || ${PORT_OPTIONS:MREPUTATION} || \ ${PORT_OPTIONS:MSTATS} . if ${PORT_OPTIONS:MBDB_BASE} CONFIGURE_ARGS+= --with-db-lib=c . else CONFIGURE_ARGS+= --with-db-incdir=${BDB_INCLUDE_DIR} \ --with-db-lib=${BDB_LIB_NAME} \ --with-db-libdir=${BDB_LIB_DIR} USES+= bdb . endif .endif .if ${PORT_OPTIONS:MCODECOVERAGE} LDFLAGS+= -lpthread .endif pre-configure: ${REINPLACE_CMD} -e '/PKG_CHECK_MODULES/s/lua5\.[0-9]/lua-${LUA_VER}/' \ -e '/PKG_CHECK_MODULES/s/cyrussasl/libsasl2/' \ ${WRKSRC}/configure.ac post-install: @${MKDIR} ${STAGEDIR}${PREFIX}/etc/mail ${INSTALL_DATA} ${WRKSRC}/opendkim/opendkim.conf.sample \ ${STAGEDIR}${PREFIX}/etc/mail/ .include diff --git a/mail/opendkim-devel/files/patch-lua_pop b/mail/opendkim-devel/files/patch-lua_pop new file mode 100644 index 000000000000..129d05d62e6d --- /dev/null +++ b/mail/opendkim-devel/files/patch-lua_pop @@ -0,0 +1,86 @@ +From 57b86d35381ed9bfb7e4be4e6512fb64163dd725 Mon Sep 17 00:00:00 2001 +From: FUTATSUKI Yasuhito +Date: Tue, 27 Feb 2024 14:41:59 +0900 +Subject: [PATCH] Lua: Fix stack level after register odkim functions. + +When luaL_setfuncs() is replaced by luaL_newlib() + lua_setglobal() +in commit 74b3374feee34fba14a0e15f89f049cbe4a3dafd, the commit did +not take account that lua_setglobal() pops a value from the stack. + +Thus, following lua pop(l, 1) tries to pop from empty stack in +Lua >= 5.2, especially in Lua 5.4, it causes abort(). + +This fix it. + +* miltertest/miltertest.c (main): + Don't pop after lua_setglobal() in Lua >= 5.2 + +* opendkim/opendkim-lua.c + (dkimf_lua_setup_hook, dkimf_lua_screen_hook, + dkimf_lua_stats_hook, dkimf_lua_final_hook): As above. +--- + miltertest/miltertest.c | 2 +- + opendkim/opendkim-lua.c | 8 ++++---- + 2 files changed, 5 insertions(+), 5 deletions(-) + +diff --git miltertest/miltertest.c miltertest/miltertest.c +index b4a345f7..339cfa91 100644 +--- miltertest/miltertest.c ++++ miltertest/miltertest.c +@@ -4014,8 +4014,8 @@ main(int argc, char **argv) + lua_setglobal(l, "mt"); + #else /* LUA_VERSION_NUM >= 502 */ + luaL_register(l, "mt", mt_library); +-#endif /* LUA_VERSION_NUM >= 502 */ + lua_pop(l, 1); ++#endif /* LUA_VERSION_NUM >= 502 */ + + /* register constants */ + lua_pushnumber(l, MT_HDRINSERT); +diff --git opendkim/opendkim-lua.c opendkim/opendkim-lua.c +index 3786aa4b..c1a67f90 100644 +--- opendkim/opendkim-lua.c ++++ opendkim/opendkim-lua.c +@@ -490,8 +490,8 @@ dkimf_lua_setup_hook(void *ctx, const char *script, size_t scriptlen, + lua_setglobal(l, "odkim"); + # else /* LUA_VERSION_NUM >= 502 */ + luaL_register(l, "odkim", dkimf_lua_lib_setup); +-# endif /* LUA_VERSION_NUM >= 502 */ + lua_pop(l, 1); ++# endif /* LUA_VERSION_NUM >= 502 */ + + /* + ** Register constants. +@@ -649,8 +649,8 @@ dkimf_lua_screen_hook(void *ctx, const char *script, size_t scriptlen, + lua_setglobal(l, "odkim"); + # else /* LUA_VERSION_NUM >= 502 */ + luaL_register(l, "odkim", dkimf_lua_lib_screen); +-# endif /* LUA_VERSION_NUM >= 502 */ + lua_pop(l, 1); ++# endif /* LUA_VERSION_NUM >= 502 */ + + /* + ** Register constants. +@@ -798,8 +798,8 @@ dkimf_lua_stats_hook(void *ctx, const char *script, size_t scriptlen, + lua_setglobal(l, "odkim"); + # else /* LUA_VERSION_NUM >= 502 */ + luaL_register(l, "odkim", dkimf_lua_lib_stats); +-# endif /* LUA_VERSION_NUM >= 502 */ + lua_pop(l, 1); ++# endif /* LUA_VERSION_NUM >= 502 */ + + /* + ** Register constants. +@@ -1039,8 +1039,8 @@ dkimf_lua_final_hook(void *ctx, const char *script, size_t scriptlen, + lua_setglobal(l, "odkim"); + # else /* LUA_VERSION_NUM >= 502 */ + luaL_register(l, "odkim", dkimf_lua_lib_final); +-# endif /* LUA_VERSION_NUM >= 502 */ + lua_pop(l, 1); ++# endif /* LUA_VERSION_NUM >= 502 */ + + /* + ** Register constants. +-- +2.45.2 +