diff --git a/databases/freetds/Makefile b/databases/freetds/Makefile index a9cce45c5a65..0283890c5679 100644 --- a/databases/freetds/Makefile +++ b/databases/freetds/Makefile @@ -1,84 +1,86 @@ # Created by: Domas Mituzas PORTNAME= freetds PORTVERSION= 1.3.10 +PORTREVISION= 1 PORTEPOCH= 1 CATEGORIES= databases MASTER_SITES= https://www.freetds.org/files/stable/ \ ftp://ftp.freetds.org/pub/freetds/stable/ MAINTAINER= bofh@FreeBSD.org COMMENT= Sybase/Microsoft TDS protocol library LICENSE= GPLv2 LIB_DEPENDS= libgcrypt.so:security/libgcrypt USES= autoreconf cpe gettext gmake iconv libtool:keepla pkgconfig \ readline tar:bzip2 USE_LDCONFIG= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --enable-msdblib \ --enable-sybase-compat \ --sysconfdir=${ETCDIR} \ --with-tdsver=${TDS_VER} INSTALL_TARGET= install-strip CPPFLAGS+= -I${LOCALBASE}/include LDFLAGS+= -L${LOCALBASE}/lib LIBS+= -lgcrypt -lpthread CONFLICTS= freetds-devel PORTDOCS= * OPTIONS_DEFINE= DOCS MARS OPTIONS_DEFAULT= MARS OPENSSL UNIXODBC OPTIONS_SINGLE= ODBC SSL OPTIONS_SINGLE_ODBC= IODBC UNIXODBC OPTIONS_SINGLE_SSL= GNUTLS OPENSSL MARS_DESC= Enable MARS code (Experimental) GNUTLS_LIB_DEPENDS= libgnutls.so:security/gnutls GNUTLS_CONFIGURE_ON= --with-gnutls IODBC_LIB_DEPENDS= libiodbc.so:databases/libiodbc IODBC_CONFIGURE_ON= --with-iodbc=${LOCALBASE} IODBC_CPPFLAGS= -I${LOCALBASE}/include/libiodbc MARS_CONFIGURE_ON= --enable-mars OPENSSL_USES= ssl OPENSSL_CONFIGURE_ON= --with-openssl=${OPENSSLBASE} UNIXODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC UNIXODBC_CONFIGURE_ON= --with-unixodbc=${LOCALBASE} TDS_VER?= 7.4 .include .if ${PORT_OPTIONS:MIODBC} || ${PORT_OPTIONS:MUNIXODBC} PLIST_SUB+= ODBC="" .else PLIST_SUB+= ODBC="@comment " .endif post-extract: @cd ${WRKSRC} && ${LN} -s freetds.conf freetds.conf.sample @cd ${WRKSRC} && ${LN} -s locales.conf locales.conf.sample @cd ${WRKSRC}/src/pool && ${LN} -s pool.conf pool.conf.sample post-patch: @${REINPLACE_CMD} -e 's|/freetds.conf|/freetds.conf.sample|g ; \ s|/locales.conf|/locales.conf.sample|g ; \ s| common.h||g' \ ${WRKSRC}/Makefile.am @${REINPLACE_CMD} -e 's|/pool.conf|/pool.conf.sample|g' \ ${WRKSRC}/src/pool/Makefile.am - @${REINPLACE_CMD} -e 's|\($$with_iodbc/include\)|\1/libiodbc|g' \ + @${REINPLACE_CMD} -e 's|\($$with_iodbc/include\)|\1/libiodbc|g ; \ + s| odbcss.h||g' \ ${WRKSRC}/configure.ac post-install: ${INSTALL_DATA} ${WRKSRC}/interfaces ${STAGEDIR}${ETCDIR}/interfaces.sample .include diff --git a/databases/freetds/files/patch-src_tds_tls.c b/databases/freetds/files/patch-src_tds_tls.c index 07a8cb8ec5ac..35612e6faff3 100644 --- a/databases/freetds/files/patch-src_tds_tls.c +++ b/databases/freetds/files/patch-src_tds_tls.c @@ -1,29 +1,89 @@ ---- src/tds/tls.c.orig 2017-11-30 09:00:01 UTC +--- src/tds/tls.c.orig 2021-08-31 09:00:01 UTC +++ src/tds/tls.c -@@ -50,6 +50,10 @@ +@@ -53,6 +53,10 @@ #include #endif +#if defined(__FreeBSD__) || defined(__DragonFly__) +#include +#endif + #include - #include + #include #include -@@ -72,6 +76,15 @@ +@@ -63,7 +67,7 @@ + + /** + * \addtogroup network +- * @{ ++ * @{ + */ + + #if defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL) +@@ -75,6 +79,15 @@ #define SSL_PTR ptr #else +#ifdef LIBRESSL_VERSION_NUMBER +#if LIBRESSL_VERSION_NUMBER < 0x2070000FL +static pthread_mutex_t *openssllocks; +#undef OPENSSL_VERSION_NUMBER +#define OPENSSL_VERSION_NUMBER 0x1000107fL +#endif +#define TLS_ST_OK SSL_ST_OK +#endif + /* some compatibility layer */ - #if OPENSSL_VERSION_NUMBER < 0x1010000FL + #if !HAVE_BIO_GET_DATA static inline void +@@ -115,7 +128,7 @@ tds_pull_func_login(SSL_PULL_ARGS) + int have; + + tdsdump_log(TDS_DBG_FUNC, "in tds_pull_func_login\n"); +- ++ + /* here we are initializing (crypted inside TDS packets) */ + + /* if we have some data send it */ +@@ -450,7 +463,7 @@ tds_ssl_init(TDSSOCKET *tds) + const char *tls_msg; + + xcred = NULL; +- session = NULL; ++ session = NULL; + tls_msg = "initializing tls"; + + if (!tls_initialized) { +@@ -826,18 +839,25 @@ check_name_match(ASN1_STRING *name, const char *hostna + static int + check_name_match(ASN1_STRING *name, const char *hostname) + { +- char *name_utf8 = NULL; ++ char *name_utf8 = NULL, *tmp_name; + int ret, name_len; + + name_len = ASN1_STRING_to_UTF8((unsigned char **) &name_utf8, name); + if (name_len < 0) + return 0; + ++ tmp_name = tds_strndup(name_utf8, name_len); ++ OPENSSL_free(name_utf8); ++ if (!tmp_name) ++ return 0; ++ ++ name_utf8 = tmp_name; ++ + tdsdump_log(TDS_DBG_INFO1, "Got name %s\n", name_utf8); + ret = 0; + if (strlen(name_utf8) == name_len && check_wildcard(name_utf8, hostname)) + ret = 1; +- OPENSSL_free(name_utf8); ++ free(name_utf8); + return ret; + } + +@@ -1095,4 +1115,3 @@ tds_ssl_deinit(TDSCONNECTION *conn) + + #endif + /** @} */ +-