Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103163665
D11285.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
29 KB
Referenced Files
None
Subscribers
None
D11285.id.diff
View Options
Index: head/UPDATING
===================================================================
--- head/UPDATING
+++ head/UPDATING
@@ -5,6 +5,33 @@
You should get into the habit of checking this file for changes each time
you update your ports collection, before attempting any port upgrades.
+20170712:
+ AFFECTS: users of devel/apr1
+ AUTHOR: brnrd@FreeBSD.org
+
+ APR was updated to 1.6.0 and APR-util was updated to 1.6.2
+
+ The Apache Portable Runtime project removed support for FreeTDS from the
+ APR Utilities in version 1.6. Users of FreeTDS will have to migrate
+ configurations to use the newly added ODBC support in conjunction with
+ FreeTDS using FreeTDS' ODBC capabilities.
+
+ Please rebuild all ports which are using functions from APR/APR-util
+ such as Apache, Subversion, etc. Normally, you can obtain the list of
+ dependent software by running the following command:
+
+ # pkg info -r libressl
+
+ Then you should rebuild all ports depending on APR(-util) to avoid
+ dangling shared library dependencies. Poudriere and pkg handle this
+ correctly, portmaster and portupgrade users can use the following to
+ rebuild all dependent ports.
+
+ Portmaster users:
+ portmaster -r apr1
+ Portupgrade users:
+ portupgrade -fr devel/apr1
+
20170710:
AFFECTS: users of net-im/ejabberd
AUTHOR: ashish@FreeBSD.org
Index: head/devel/apr1/Makefile
===================================================================
--- head/devel/apr1/Makefile
+++ head/devel/apr1/Makefile
@@ -3,7 +3,6 @@
PORTNAME= apr
PORTVERSION= ${APR_VERSION}.${APU_VERSION}
-PORTREVISION= 2
CATEGORIES= devel
MASTER_SITES= APACHE/apr
DISTFILES= apr-${APR_VERSION}.tar.gz \
@@ -20,21 +19,23 @@
USE_LDCONFIG= yes
GNU_CONFIGURE= yes
-APR_VERSION= 1.5.2
-APU_VERSION= 1.5.4
+APR_VERSION= 1.6.2
+APU_VERSION= 1.6.0
CPE_VENDOR= apache
CPE_PRODUCT= apr-util
CPE_VERSION= ${APU_VERSION}
OPTIONS_SUB= yes
-OPTIONS_GROUP= APR APU
-OPTIONS_GROUP_APR= IPV6 DEVRANDOM
-OPTIONS_GROUP_APU= BDB GDBM LDAP MYSQL NDBM PGSQL SQLITE FREETDS
+OPTIONS_GROUP= APU
+OPTIONS_DEFINE= IPV6 DEVRANDOM
+OPTIONS_GROUP_APU= BDB GDBM LDAP MYSQL NDBM ODBC PGSQL SQLITE
OPTIONS_RADIO= CRYPTO
OPTIONS_RADIO_CRYPTO= SSL NSS
OPTIONS_DEFAULT= DEVRANDOM BDB GDBM SSL
+APU_DESC= Database support
+CRYPTO_DESC= Cryptography provider
DEVRANDOM_DESC= Use /dev/random or compatible
NDBM_DESC= NDBM support
NSS_DESC= NSS crypto driver
@@ -42,11 +43,11 @@
# APR-Util Options
BDB_USES= bdb:5+
-FREETDS_LIB_DEPENDS= libsybdb.so:databases/freetds
GDBM_LIB_DEPENDS= libgdbm.so:databases/gdbm
LDAP_USE= OPENLDAP=yes
MYSQL_USE= MYSQL=yes
NSS_LIB_DEPENDS= libnss3.so:security/nss
+ODBC_LIB_DEPENDS= libodbc.so:databases/unixODBC
PGSQL_USES= pgsql
SQLITE_USES= sqlite
SSL_USES= ssl
@@ -71,78 +72,50 @@
--with-expat=${LOCALBASE} \
--with-iconv=${ICONV_PREFIX}
-.include <bsd.port.options.mk>
-
########## APR Options
-.if ${PORT_OPTIONS:MIPV6}
-APR_CONF_ARGS+= --enable-ipv6
-.else
-APR_CONF_ARGS+= --disable-ipv6
-.endif
+IPV6_VARS= APR_CONF_ARGS+=--enable-ipv6
+IPV6_VARS_OFF= APR_CONF_ARGS+=--disable-ipv6
+DEVRANDOM_VARS= APR_CONF_ARGS+=--with-devrandom
+DEVRANDOM_VARS_OFF= APR_CONF_ARGS+=--without-devrandom
-.if ${PORT_OPTIONS:MDEVRANDOM}
-APR_CONF_ARGS+= --with-devrandom
-.else
-APR_CONF_ARGS+= --without-devrandom
-.endif
-
######### APR-Util Options
# make sure 1st include is "${APR_WRKDIR}/include"
# to avoid failures if previous apr_version.h is present
APU_CPPFLAGS= -I${APR_WRKDIR}/include
-.if ${PORT_OPTIONS:MGDBM}
-APU_CONF_ARGS+= --with-gdbm=${LOCALBASE}
-.else
-APU_CONF_ARGS+= --without-gdbm
-.endif
+BDB_VARS= APU_CONF_ARGS+=--with-berkeley-db=${BDB_INCLUDE_DIR}:${BDB_LIB_DIR}
+BDB_VARS_OFF= APU_CONF_ARGS+=--without-berkeley-db
+GDBM_VARS= APU_CONF_ARGS+=--with-gdbm=${LOCALBASE}
+LDAP_VARS= APU_CONF_ARGS+="--with-ldap-include=${LOCALBASE}/include \
+ --with-ldap-lib=${LOCALBASE}/lib --with-ldap=ldap"
+MYSQL_VARS= APU_CONF_ARGS+=--with-mysql=${LOCALBASE} \
+ APU_CPPFLAGS+="-I${LOCALBASE}/include -I${LOCALBASE}/include/mysql -DHAVE_MYSQL_H" \
+ LIBS+=-L${LOCALBASE}/lib/mysql
-.if ${PORT_OPTIONS:MBDB}
-APU_CONF_ARGS+= --with-berkeley-db=${BDB_INCLUDE_DIR}:${BDB_LIB_DIR}
-.else
-APU_CONF_ARGS+= --without-berkeley-db
-.endif
+NDBM_VARS= APU_CONF_ARGS+=--with-ndbm=/usr
+NSS_VARS= APU_CONF_ARGS+=--with-nss=${LOCALBASE} \
+ APU_CPPFLAGS+=-I${LOCALBASE}/include/nss \
+ LDFLAGS+=-L${LOCALBASE}/lib/nss
+ODBC_VARS= APU_CONF_ARGS+=--with-odbc=${LOCALBASE}
+SSL_VARS= APU_CONF_ARGS+=--with-openssl=${OPENSSLBASE} \
+ APU_CPPFLAGS+=-I${OPENSSLINC} \
+ LDFLAGS+=-L${OPENSSLLIB}
+SSL_VARS_OFF= APU_CONF_ARGS+=--without-openssl
+PGSQL_VARS= APU_CONF_ARGS+=--with-pgsql=${LOCALBASE} \
+ APU_CONF_ENV+=ac_cv_path_PGSQL_CONFIG=""
+SQLITE_VARS= APU_CONF_ENV+=--with-sqlite3=${LOCALBASE}
+SQLITE_VARS_OFF= APU_CONF_ARGS+=--without-sqlite3
-.if ${PORT_OPTIONS:MNDBM}
-APU_CONF_ARGS+= --with-ndbm=/usr
-.else
-APU_CONF_ARGS+= --without-ndbm
-.endif
+.for db in GDBM NDBM LDAP ODBC MYSQL NSS PGSQL
+${db}_VARS_OFF= APU_CONF_ARGS+=--without-${db:tl}
+.endfor
-.if ${PORT_OPTIONS:MLDAP}
-APU_CONF_ARGS+= --with-ldap-include=${LOCALBASE}/include \
- --with-ldap-lib=${LOCALBASE}/lib --with-ldap=ldap
-.else
-APU_CONF_ARGS+= --without-ldap
-.endif
+APR_CONF_ENV+= ${CONFIGURE_ENV:O:u} CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}"
+# include apu specific CPPFLAGS 1st!
+APU_CONF_ENV+= ${CONFIGURE_ENV:O:u} CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${APU_CPPFLAGS} ${CPPFLAGS}"
-.if ${PORT_OPTIONS:MFREETDS}
-APU_CONF_ARGS+= --with-freetds=${LOCALBASE}
-.else
-APU_CONF_ARGS+= --without-freetds
-.endif
+.include <bsd.port.options.mk>
-.if ${PORT_OPTIONS:MMYSQL}
-APU_CONF_ARGS+= --with-mysql=${LOCALBASE}
-APU_CPPFLAGS+= -I${LOCALBASE}/include -I${LOCALBASE}/include/mysql -DHAVE_MYSQL_H
-LIBS+= -L${LOCALBASE}/lib/mysql
-.else
-APU_CONF_ARGS+= --without-mysql
-.endif
-
-.if ${PORT_OPTIONS:MPGSQL}
-APU_CONF_ARGS+= --with-pgsql=${LOCALBASE}
-APU_CONF_ENV+= ac_cv_path_PGSQL_CONFIG=""
-.else
-APU_CONF_ARGS+= --without-pgsql
-.endif
-
-.if ${PORT_OPTIONS:MSQLITE}
-APU_CONF_ARGS+= --with-sqlite3=${LOCALBASE}
-.else
-APU_CONF_ARGS+= --without-sqlite3
-.endif
-
# crypto (apache24)
.if ${PORT_OPTIONS:MSSL} || ${PORT_OPTIONS:MNSS}
APU_CONF_ARGS+= --with-crypto
@@ -150,29 +123,9 @@
APU_CONF_ARGS+= --without-crypto
.endif
-.if ${PORT_OPTIONS:MSSL}
-APU_CPPFLAGS+= -I${OPENSSLINC}
-LDFLAGS+= -L${OPENSSLLIB}
-APU_CONF_ARGS+= --with-openssl=${OPENSSLBASE}
-.else
-APU_CONF_ARGS+= --without-openssl
-.endif
-
-.if ${PORT_OPTIONS:MNSS}
-APU_CPPFLAGS+= -I${LOCALBASE}/include/nss
-LDFLAGS+= -L${LOCALBASE}/lib/nss
-APU_CONF_ARGS+= --with-nss=${LOCALBASE}
-.else
-APU_CONF_ARGS+= --without-nss
-.endif
-
-APR_CONF_ENV+= ${CONFIGURE_ENV:O:u} CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${CPPFLAGS}"
-# include apu specific CPPFLAGS 1st!
-APU_CONF_ENV+= ${CONFIGURE_ENV:O:u} CC="${CC}" CFLAGS="${CFLAGS}" CPPFLAGS="${APU_CPPFLAGS} ${CPPFLAGS}"
-
post-extract:
# cleanup files not used on this platform
- @${FIND} ${WRKSRC} -type f \( -name 'NWGNU*' -o -name '*.ds?' -o -name '*.dep' -o -name '*.mak' -o -name '*.win' \) -delete
+ @${FIND} ${WRKDIR} -type f \( -name 'NWGNU*' -o -name '*.ds?' -o -name '*.dep' -o -name '*.mak' -o -name '*.win' \) -delete
post-patch:
@${REINPLACE_CMD} -e 's/OSVERSION/${OSVERSION}/g' \
@@ -216,7 +169,7 @@
#regression-test: test
rpfl: configure
-# maintainer only: strip PID from logs (better compair)
+# maintainer only: strip PID from logs (better compare)
${SED} -i '' -E 's|^configure:[0-9]+:|configure:_pid_:|g' ${APR_WRKDIR}/config.log
${SED} -i '' -E 's|^configure:[0-9]+:|configure:_pid_:|g' ${APU_WRKDIR}/config.log
Index: head/devel/apr1/distinfo
===================================================================
--- head/devel/apr1/distinfo
+++ head/devel/apr1/distinfo
@@ -1,4 +1,5 @@
-SHA256 (apr-1.5.2.tar.gz) = 1af06e1720a58851d90694a984af18355b65bb0d047be03ec7d659c746d6dbdb
-SIZE (apr-1.5.2.tar.gz) = 1031613
-SHA256 (apr-util-1.5.4.tar.gz) = 976a12a59bc286d634a21d7be0841cc74289ea9077aa1af46be19d1a6e844c19
-SIZE (apr-util-1.5.4.tar.gz) = 874044
+TIMESTAMP = 1499711633
+SHA256 (apr-1.6.2.tar.gz) = 4fc24506c968c5faf57614f5d0aebe0e9d0b90afa47a883e1a1ca94f15f4a42e
+SIZE (apr-1.6.2.tar.gz) = 1071074
+SHA256 (apr-util-1.6.0.tar.gz) = 483ef4d59e6ac9a36c7d3fd87ad7b9db7ad8ae29c06b9dd8ff22dda1cc416389
+SIZE (apr-util-1.6.0.tar.gz) = 565507
Index: head/devel/apr1/files/patch-apr-util__dbd__apr_dbd_freetds.c
===================================================================
--- head/devel/apr1/files/patch-apr-util__dbd__apr_dbd_freetds.c
+++ head/devel/apr1/files/patch-apr-util__dbd__apr_dbd_freetds.c
@@ -1,554 +0,0 @@
-# http://lists.freebsd.org/pipermail/freebsd-apache/2013-January/003020.html
-#
-# From: "Mikhail T." <mi+thun@aldan.algebra.com>
-# I've made the FreeTDS-driver work again -- and submitted the patch to Apache:
-# https://issues.apache.org/bugzilla/show_bug.cgi?id=53666
-===================================================================================
---- apr-util-1.5.4/dbd/apr_dbd_freetds.c.orig 2012-08-05 21:09:15 UTC
-+++ apr-util-1.5.4/dbd/apr_dbd_freetds.c
-@@ -40,12 +40,12 @@
- #include <freetds/sybdb.h>
- #endif
- #ifdef HAVE_SYBDB_H
-+#include <sybfront.h>
- #include <sybdb.h>
- #endif
-
- #include <stdio.h>
- #include <sys/types.h>
--#include <regex.h>
-
- /* This probably needs to change for different applications */
- #define MAX_COL_LEN 256
-@@ -67,6 +67,7 @@ struct apr_dbd_t {
- apr_dbd_transaction_t *trans;
- apr_pool_t *pool;
- const char *params;
-+ const char *lasterror;
- RETCODE err;
- };
-
-@@ -80,20 +81,20 @@ struct apr_dbd_results_t {
-
- struct apr_dbd_row_t {
- apr_dbd_results_t *res;
-- BYTE buf[MAX_COL_LEN];
-+ apr_pool_t *pool;
- };
-
- struct apr_dbd_prepared_t {
- int nargs;
-- regex_t **taint;
-- int *sz;
-- char *fmt;
-+ int fmtlen;
-+ const char *fmt, *label;
-+ apr_dbd_type_e *types;
-+ int offsets[];
- };
-
--#define dbd_freetds_is_success(x) (x == SUCCEED)
-+const apr_dbd_driver_t apr_dbd_freetds_driver; /* Forward declaration */
-
--static int labelnum = 0; /* FIXME */
--static regex_t dbd_freetds_find_arg;
-+#define dbd_freetds_is_success(x) (x == SUCCEED)
-
- /* execute a query that doesn't return a result set, mop up,
- * and return and APR-flavoured status
-@@ -102,7 +103,11 @@ static RETCODE freetds_exec(DBPROCESS *p
- int want_results, int *nrows)
- {
- /* TBD */
-- RETCODE rv = dbcmd(proc, query);
-+ RETCODE rv = dbcmd(proc,
-+#ifndef TDS_STATIC_CAST /* if not compiling against FreeTDS, drop const :-( */
-+ (char *)
-+#endif
-+ query);
- if (rv != SUCCEED) {
- return rv;
- }
-@@ -143,6 +148,7 @@ static int dbd_freetds_select(apr_pool_t
- * Ignore seek
- */
-
-+ sql->lasterror = NULL;
- sql->err = freetds_exec(sql->proc, query, 1, NULL);
- if (!dbd_freetds_is_success(sql->err)) {
- if (sql->trans) {
-@@ -190,51 +196,38 @@ static int dbd_freetds_select(apr_pool_t
- #endif
- return (sql->err == SUCCEED) ? 0 : 1;
- }
--static const char *dbd_untaint(apr_pool_t *pool, regex_t *rx, const char *val)
--{
-- regmatch_t match[1];
-- if (rx == NULL) {
-- /* no untaint expression */
-- return val;
-- }
-- if (regexec(rx, val, 1, match, 0) == 0) {
-- return apr_pstrndup(pool, val+match[0].rm_so,
-- match[0].rm_eo - match[0].rm_so);
-- }
-- return "";
--}
-+
- static const char *dbd_statement(apr_pool_t *pool,
-- apr_dbd_prepared_t *stmt,
-- int nargs, const char **args)
-+ const apr_dbd_prepared_t *stmt,
-+ const char **args)
- {
- int i;
- int len;
-- const char *var;
- char *ret;
-- const char *p_in;
-+ const char *p_in, *format;
- char *p_out;
-- char *q;
-
-- /* compute upper bound on length (since untaint shrinks) */
-- len = strlen(stmt->fmt) +1;
-- for (i=0; i<nargs; ++i) {
-- len += strlen(args[i]) - 2;
-+ len = stmt->fmtlen;
-+ for (i=0; i < stmt->nargs; ++i) {
-+ len += strlen(args[i]);
-+ switch (stmt->types[i]) {
-+ case APR_DBD_TYPE_STRING: len += 2; break; /* For the quotes */
-+ default: break;/* Other types are all taken verbatim at the moment */
-+ }
- }
-- i = 0;
- p_in = stmt->fmt;
- p_out = ret = apr_palloc(pool, len);
-- /* FIXME silly bug - this'll catch %%s */
-- while (q = strstr(p_in, "%s"), q != NULL) {
-- len = q-p_in;
-- strncpy(p_out, p_in, len);
-- p_in += len;
-- p_out += len;
-- var = dbd_untaint(pool, stmt->taint[i], args[i]);
-- len = strlen(var);
-- strncpy(p_out, var, len);
-- p_in += 2;
-- p_out += len;
-- ++i;
-+ for (i = 0; i < stmt->nargs; i++) {
-+ len = stmt->offsets[i];
-+ switch (stmt->types[i]) {
-+ case APR_DBD_TYPE_STRING:
-+ format = "%.*s'%s'";
-+ break;
-+ default:
-+ format = "%.*s%s";
-+ }
-+ p_out += sprintf(p_out, format, len, p_in, args[i]);
-+ p_in += (len + 1);
- }
- strcpy(p_out, p_in);
- return ret;
-@@ -244,8 +237,7 @@ static int dbd_freetds_pselect(apr_pool_
- apr_dbd_prepared_t *statement,
- int seek, const char **values)
- {
-- const char *query = dbd_statement(pool, statement,
-- statement->nargs, values);
-+ const char *query = dbd_statement(pool, statement, values);
- return dbd_freetds_select(pool, sql, results, query, seek);
- }
- static int dbd_freetds_pvselect(apr_pool_t *pool, apr_dbd_t *sql,
-@@ -273,8 +265,7 @@ static int dbd_freetds_pquery(apr_pool_t
- int *nrows, apr_dbd_prepared_t *statement,
- const char **values)
- {
-- const char *query = dbd_statement(pool, statement,
-- statement->nargs, values);
-+ const char *query = dbd_statement(pool, statement, values);
- return dbd_freetds_query(sql, nrows, query);
- }
- static int dbd_freetds_pvquery(apr_pool_t *pool, apr_dbd_t *sql, int *nrows,
-@@ -301,11 +292,13 @@ static int dbd_freetds_get_row(apr_pool_
- RETCODE rv = 0;
- apr_dbd_row_t *row = *rowp;
- int sequential = ((rownum >= 0) && res->random) ? 0 : 1;
-+ apr_dbd_t *sql = (void *)dbgetuserdata(res->proc);
-
- if (row == NULL) {
- row = apr_palloc(pool, sizeof(apr_dbd_row_t));
- *rowp = row;
- row->res = res;
-+ row->pool = pool; /* For subsequent calls to get_entry */
- }
- /*
- else {
-@@ -321,18 +314,37 @@ static int dbd_freetds_get_row(apr_pool_
- rv = dbnextrow(res->proc);
- }
- else {
-+ /* XXX dbgetrow() only works if DBBUFFER-option is set */
- rv = (rownum >= 0) ? dbgetrow(res->proc, rownum) : NO_MORE_ROWS;
- }
- switch (rv) {
- case SUCCEED: return 0;
- case REG_ROW: return 0;
- case NO_MORE_ROWS:
-+ if (dbisopt(res->proc, DBBUFFER, NULL) || sequential) {
-+ sql->lasterror = apr_pstrcat(sql->pool,
-+ "NO_MORE_ROWS (count: ", apr_itoa(sql->pool, DBCOUNT(res->proc)),
-+ ", first: ", apr_itoa(sql->pool, DBFIRSTROW(res->proc)),
-+ ", current: ", apr_itoa(sql->pool, DBCURROW(res->proc)),
-+ ", last: ", apr_itoa(sql->pool, DBLASTROW(res->proc)),
-+ ")", NULL);;
-+ } else {
-+ sql->lasterror = "NO_MORE_ROWS (DBBUFFER option must be on "
-+ "for dbgetrow() to work)";
-+ }
- apr_pool_cleanup_run(res->pool, res->proc, clear_result);
- *rowp = NULL;
- return -1;
-- case FAIL: return 1;
-- case BUF_FULL: return 2; /* FIXME */
-- default: return 3;
-+ case FAIL:
-+ sql->lasterror = "FAIL";
-+ return 1;
-+ case BUF_FULL:
-+ sql->lasterror = "BUF_FULL";
-+ return 2; /* FIXME */
-+ default:
-+ sql->lasterror = apr_pstrcat(res->pool,
-+ "Unexpected error number ", apr_itoa(res->pool, rv), NULL);
-+ return 3;
- }
-
- return 0;
-@@ -340,24 +352,27 @@ static int dbd_freetds_get_row(apr_pool_
-
- static const char *dbd_freetds_get_entry(const apr_dbd_row_t *row, int n)
- {
-- /* FIXME: support different data types */
-- /* this fails - bind gets some vars but not others
-- return (const char*)row->res->vars[n].data;
-- */
- DBPROCESS* proc = row->res->proc;
-- BYTE *ptr = dbdata(proc, n+1);
-+ BYTE *ptr = dbdata(proc, n+1); /* XXX No error checking! */
- int t = dbcoltype(proc, n+1);
-- int l = dbcollen(proc, n+1);
-+ int l = dbdatlen(proc, n+1);
-+ if (l == -1)
-+ return NULL;
- if (dbwillconvert(t, SYBCHAR)) {
-- dbconvert(proc, t, ptr, l, SYBCHAR, (BYTE *)row->buf, -1);
-- return (const char*)row->buf;
-+ char *buf = apr_palloc(row->pool, l + 1);
-+ dbconvert(proc, t, ptr, l, SYBCHAR, buf, -1);
-+ return buf;
- }
- return (char*)ptr;
- }
-
- static const char *dbd_freetds_error(apr_dbd_t *sql, int n)
- {
-- /* XXX this doesn't seem to exist in the API ??? */
-+ const char *err = sql->lasterror;
-+
-+ sql->lasterror = NULL; /* Reset, so we stop appending */
-+ if (err)
-+ return err;
- return apr_psprintf(sql->pool, "Error %d", sql->err);
- }
-
-@@ -367,6 +382,7 @@ static int dbd_freetds_query(apr_dbd_t *
- return sql->trans->errnum;
- }
- *nrows = 0;
-+ sql->lasterror = NULL;
- sql->err = freetds_exec(sql->proc, query, 0, nrows);
-
- if (sql->err != SUCCEED) {
-@@ -384,114 +400,39 @@ static const char *dbd_freetds_escape(ap
- return arg;
- }
-
--static apr_status_t freetds_regfree(void *rx)
--{
-- regfree((regex_t*)rx);
-- return APR_SUCCESS;
--}
--static int recurse_args(apr_pool_t *pool, int n, const char *query,
-- apr_dbd_prepared_t *stmt, int offs)
--{
--
-- /* we only support %s arguments for now */
-- int ret;
-- char arg[256];
-- regmatch_t matches[3];
-- if (regexec(&dbd_freetds_find_arg, query, 3, matches, 0) != 0) {
-- /* No more args */
-- stmt->nargs = n;
-- stmt->taint = apr_palloc(pool, n*sizeof(regex_t*));
-- stmt->sz = apr_palloc(pool, n*sizeof(int));
-- ret = 0;
-- }
-- else {
-- int i;
-- int sz = 0;
-- int len = matches[1].rm_eo - matches[1].rm_so - 2;
-- if (len > 255) {
-- return 9999;
-- }
--
-- ret = recurse_args(pool, n+1, query+matches[0].rm_eo,
-- stmt, offs+matches[0].rm_eo);
--
-- memmove(stmt->fmt + offs + matches[1].rm_so,
-- stmt->fmt + offs + matches[0].rm_eo-1,
-- strlen(stmt->fmt+offs+matches[0].rm_eo)+2);
--
-- /* compile untaint to a regex if found */
-- if (matches[1].rm_so == -1) {
-- stmt->taint[n] = NULL;
-- }
-- else {
-- strncpy(arg, query+matches[1].rm_so+1,
-- matches[1].rm_eo - matches[1].rm_so - 2);
-- arg[matches[1].rm_eo - matches[1].rm_so - 2] = '\0';
-- stmt->taint[n] = apr_palloc(pool, sizeof(regex_t));
-- if (regcomp(stmt->taint[n], arg, REG_ICASE|REG_EXTENDED) != 0) {
-- ++ret;
-- }
-- else {
-- apr_pool_cleanup_register(pool, stmt->taint[n], freetds_regfree,
-- apr_pool_cleanup_null);
-- }
-- }
--
-- /* record length if specified */
-- for (i=matches[2].rm_so; i<matches[2].rm_eo; ++i) {
-- sz = 10*sz + (query[i]-'\0');
-- }
-- }
-- return ret;
--}
--
- static int dbd_freetds_prepare(apr_pool_t *pool, apr_dbd_t *sql,
- const char *query, const char *label,
- int nargs, int nvals, apr_dbd_type_e *types,
- apr_dbd_prepared_t **statement)
- {
-+ int i;
-+ const char *p, *op;
- apr_dbd_prepared_t *stmt;
-
-- if (label == NULL) {
-- label = apr_psprintf(pool, "%d", labelnum++);
-+ if (!*statement &&
-+ (*statement = apr_palloc(pool,
-+ sizeof(apr_dbd_prepared_t) + nargs*sizeof(int))) == NULL) {
-+ return APR_EGENERAL;
- }
-
-- if (!*statement) {
-- *statement = apr_palloc(pool, sizeof(apr_dbd_prepared_t));
-- }
- stmt = *statement;
-+ stmt->nargs = nargs;
-+ stmt->fmt = query;
-+ stmt->fmtlen = strlen(query) - nargs + 1;
-+ stmt->types = types;
-+ stmt->label = label; /* XXX Not used anywhere at the moment */
-
--#if 0
-- /* count args */
-- stmt->fmt = apr_pstrdup(pool, query);
-- stmt->fmt = recurse_args(pool, 0, query, stmt, stmt->fmt);
--
-- /* overestimate by a byte or two to simplify */
-- len = strlen("CREATE PROC apr.")
-- + strlen(label)
-- + stmt->nargs * strlen(" @arg1 varchar(len1),")
-- + strlen(" AS begin ")
-- + strlen(stmt->fmt)
-- + strlen(" end "); /* extra byte for terminator */
--
-- pquery = apr_pcalloc(pool, len);
-- sprintf(pquery, "CREATE PROC apr.%s", label);
-- for (i=0; i<stmt->nargs; ++i) {
-- sprintf(pquery+strlen(pquery), " @arg%d varchar(%d)", i, stmt->sz[i]);
-- if (i < stmt->nargs-1) {
-- pquery[strlen(pquery)] = ',';
-- }
-+ /*
-+ * Run through the query-template looking for the special character,
-+ * which the dbd_prepare inserted into it on our behalf
-+ */
-+ for (i = 0, op = query; i < nargs; i++) {
-+ p = strchr(op, apr_dbd_freetds_driver.pformat[0]);
-+ stmt->offsets[i] = p - op;
-+ op = p + 1;
- }
-- strcat(pquery, " AS BEGIN ");
-- strcat(pquery, stmt->fmt);
-- strcat(pquery, " END");
--
-- return (freetds_exec(sql->proc, pquery, 0, &i) == SUCCEED) ? 0 : 1;
--#else
-- stmt->fmt = apr_pstrdup(pool, query);
-- return recurse_args(pool, 0, query, stmt, 0);
--#endif
-
-+ return APR_SUCCESS;
- }
-
- static int dbd_freetds_start_transaction(apr_pool_t *pool, apr_dbd_t *handle,
-@@ -541,9 +482,9 @@ static DBPROCESS *freetds_open(apr_pool_
- DBPROCESS *process;
- LOGINREC *login;
- static const char *delims = " \r\n\t;|,";
-- char *ptr;
-- char *key;
-- char *value;
-+ const char *ptr;
-+ const char *key;
-+ const char *value;
- int vlen;
- int klen;
- char *buf;
-@@ -564,7 +505,7 @@ static DBPROCESS *freetds_open(apr_pool_
- }
- for (key = ptr-1; apr_isspace(*key); --key);
- klen = 0;
-- while (apr_isalpha(*key)) {
-+ while (key >= params && apr_isalpha(*key)) {
- --key;
- ++klen;
- }
-@@ -631,6 +572,7 @@ static apr_dbd_t *dbd_freetds_open(apr_p
- sql->pool = pool;
- sql->proc = process;
- sql->params = params;
-+ dbsetuserdata(process, (BYTE *)sql);
- return sql;
- }
-
-@@ -686,24 +628,73 @@ static int dbd_freetds_num_tuples(apr_db
- static apr_status_t freetds_term(void *dummy)
- {
- dbexit();
-- regfree(&dbd_freetds_find_arg);
- return APR_SUCCESS;
- }
-+
-+static int freetds_msg_handler(DBPROCESS *dbproc, DBINT msgno, int msgstate,
-+ int severity, char *msgtext, char *srvname,
-+ char *procname, int line)
-+{
-+ char *value;
-+ apr_dbd_t *sql;
-+
-+ if (dbproc == NULL || (sql = (void *)dbgetuserdata(dbproc)) == NULL) {
-+ /* Initial messages are not interesting */
-+ return 0;
-+ }
-+
-+ value = apr_psprintf(sql->pool, "%s: %s", srvname, msgtext);
-+ if (procname && procname[0])
-+ value = apr_pstrcat(sql->pool, value, " In procedure ",
-+ procname, NULL);
-+ if (line)
-+ value = apr_pstrcat(sql->pool, value,
-+ procname && procname[0] ? ", line " : " Line ",
-+ apr_itoa(sql->pool, line), NULL);
-+
-+ if (sql->lasterror)
-+ sql->lasterror = apr_pstrcat(sql->pool, sql->lasterror, "\n", value, NULL);
-+ else
-+ sql->lasterror = value;
-+
-+ return 0;
-+}
-+
- static int freetds_err_handler(DBPROCESS *dbproc, int severity, int dberr,
- int oserr, char *dberrstr, char *oserrstr)
- {
-+ char *value;
-+ apr_dbd_t *sql;
-+
-+ if (dbproc == NULL || (sql = (void *)dbgetuserdata(dbproc)) == NULL) {
-+ fprintf(stderr, "%s\n", dberrstr);
-+ return INT_CANCEL;
-+ }
-+ /*
-+ * Do not append the useless "general error", if details
-+ * are already recorded (by the msg_handler). Just return.
-+ * XXX: this skipping currently only works with Sybase's OpenClient
-+ * XXX: because FreeTDS implementation uses bogus dberr values:
-+ * XXX: https://sourceforge.net/tracker/?func=detail&aid=3555777&group_id=33106&atid=407806
-+ */
-+ if (dberr == SYBESMSG && sql->lasterror)
-+ return INT_CANCEL;
-+
-+ value = apr_psprintf(sql->pool, "%d: %s", dberr, dberrstr);
-+ if (oserrstr) {
-+ value = apr_pstrcat(sql->pool, ". (", oserrstr, ")", NULL);
-+ }
-+ if (sql->lasterror)
-+ sql->lasterror = apr_pstrcat(sql->pool, sql->lasterror, "\n", value, NULL);
-+ else
-+ sql->lasterror = value;
- return INT_CANCEL; /* never exit */
- }
- static void dbd_freetds_init(apr_pool_t *pool)
- {
-- int rv = regcomp(&dbd_freetds_find_arg,
-- "%(\\{[^}]*\\})?([0-9]*)[A-Za-z]", REG_EXTENDED);
-- if (rv != 0) {
-- char errmsg[256];
-- regerror(rv, &dbd_freetds_find_arg, errmsg, 256);
-- fprintf(stderr, "regcomp failed: %s\n", errmsg);
-- }
-- dbinit();
-+ if (dbinit() == FAIL)
-+ fprintf(stderr, "dbinit() failed\n");
-+ dbmsghandle(freetds_msg_handler);
- dberrhandle(freetds_err_handler);
- apr_pool_cleanup_register(pool, NULL, freetds_term, apr_pool_cleanup_null);
- }
-@@ -765,7 +756,11 @@ static apr_status_t dbd_freetds_datum_ge
- #endif
-
- APU_MODULE_DECLARE_DATA const apr_dbd_driver_t apr_dbd_freetds_driver = {
-+#ifndef TI_MODULE_NAME
- "freetds",
-+#else
-+ TI_MODULE_NAME,
-+#endif
- dbd_freetds_init,
- dbd_freetds_native,
- dbd_freetds_open,
-@@ -787,19 +782,14 @@ APU_MODULE_DECLARE_DATA const apr_dbd_dr
- dbd_freetds_pvselect,
- dbd_freetds_pquery,
- dbd_freetds_pselect,
-- /* this is only implemented to support httpd/2.2 standard usage,
-- * as in the original DBD implementation. Everything else is NOTIMPL.
-- */
--#ifdef COMPILE_STUBS
- dbd_freetds_get_name,
- dbd_freetds_transaction_mode_get,
- dbd_freetds_transaction_mode_set,
-- "",
-+ "\1", /* Would not occur in a real query... */
- dbd_freetds_pvbquery,
- dbd_freetds_pvbselect,
- dbd_freetds_pbquery,
- dbd_freetds_pbselect,
- dbd_freetds_datum_get
--#endif
- };
- #endif
Index: head/devel/apr1/files/patch-apr__configure
===================================================================
--- head/devel/apr1/files/patch-apr__configure
+++ head/devel/apr1/files/patch-apr__configure
@@ -1,5 +1,5 @@
---- apr-1.5.2/configure.orig 2015-04-25 12:04:18 UTC
-+++ apr-1.5.2/configure
+--- apr-1.6.2/configure.orig 2015-04-25 12:04:18 UTC
++++ apr-1.6.2/configure
@@ -6624,11 +6624,7 @@ if test "x$apr_preload_done" != "xyes" ;
apr_lock_method="USE_FLOCK_SERIALIZE"
fi
Index: head/devel/apr1/files/patch-apr_poll_unix_kqueue.c
===================================================================
--- head/devel/apr1/files/patch-apr_poll_unix_kqueue.c
+++ head/devel/apr1/files/patch-apr_poll_unix_kqueue.c
@@ -1,8 +1,8 @@
# upstram PR: https://bz.apache.org/bugzilla/show_bug.cgi?id=59914
# FreeBSD PR: 211430
========================================================================
---- apr-1.5.2/poll/unix/kqueue.c.orig 2015-03-20 01:34:07 UTC
-+++ apr-1.5.2/poll/unix/kqueue.c
+--- apr-1.6.2/poll/unix/kqueue.c.orig 2015-03-20 01:34:07 UTC
++++ apr-1.6.2/poll/unix/kqueue.c
@@ -25,21 +25,40 @@
#ifdef HAVE_KQUEUE
Index: head/devel/apr1/pkg-plist
===================================================================
--- head/devel/apr1/pkg-plist
+++ head/devel/apr1/pkg-plist
@@ -7,6 +7,7 @@
include/apr-1/apr_base64.h
include/apr-1/apr_buckets.h
include/apr-1/apr_crypto.h
+include/apr-1/apr_cstr.h
include/apr-1/apr_date.h
include/apr-1/apr_dbd.h
include/apr-1/apr_dbm.h
@@ -36,12 +37,14 @@
include/apr-1/apr_network_io.h
include/apr-1/apr_optional.h
include/apr-1/apr_optional_hooks.h
+include/apr-1/apr_perms_set.h
include/apr-1/apr_poll.h
include/apr-1/apr_pools.h
include/apr-1/apr_portable.h
include/apr-1/apr_proc_mutex.h
include/apr-1/apr_queue.h
include/apr-1/apr_random.h
+include/apr-1/apr_redis.h
include/apr-1/apr_reslist.h
include/apr-1/apr_ring.h
include/apr-1/apr_rmm.h
@@ -49,6 +52,7 @@
include/apr-1/apr_sha1.h
include/apr-1/apr_shm.h
include/apr-1/apr_signal.h
+include/apr-1/apr_siphash.h
include/apr-1/apr_skiplist.h
include/apr-1/apr_strings.h
include/apr-1/apr_strmatch.h
@@ -78,12 +82,12 @@
%%SSL%%lib/apr-util-1/apr_crypto_openssl-1.so
%%SSL%%lib/apr-util-1/apr_crypto_openssl.a
%%SSL%%lib/apr-util-1/apr_crypto_openssl.so
-%%FREETDS%%lib/apr-util-1/apr_dbd_freetds-1.so
-%%FREETDS%%lib/apr-util-1/apr_dbd_freetds.a
-%%FREETDS%%lib/apr-util-1/apr_dbd_freetds.so
%%MYSQL%%lib/apr-util-1/apr_dbd_mysql-1.so
%%MYSQL%%lib/apr-util-1/apr_dbd_mysql.a
%%MYSQL%%lib/apr-util-1/apr_dbd_mysql.so
+%%ODBC%%lib/apr-util-1/apr_dbd_odbc-1.so
+%%ODBC%%lib/apr-util-1/apr_dbd_odbc.a
+%%ODBC%%lib/apr-util-1/apr_dbd_odbc.so
%%PGSQL%%lib/apr-util-1/apr_dbd_pgsql-1.so
%%PGSQL%%lib/apr-util-1/apr_dbd_pgsql.a
%%PGSQL%%lib/apr-util-1/apr_dbd_pgsql.so
@@ -114,7 +118,9 @@
lib/libaprutil-1.so.%%SHLIB_APU_MAJOR%%
libdata/pkgconfig/apr-1.pc
libdata/pkgconfig/apr-util-1.pc
+%%DATADIR%%/build-1/apr_common.m4
%%DATADIR%%/build-1/apr_rules.mk
+%%DATADIR%%/build-1/find_apr.m4
%%DATADIR%%/build-1/libtool
%%DATADIR%%/build-1/make_exports.awk
%%DATADIR%%/build-1/make_var_export.awk
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 22, 6:53 PM (8 h, 21 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14759051
Default Alt Text
D11285.id.diff (29 KB)
Attached To
Mode
D11285: devel/apr1: Update to 1.6
Attached
Detach File
Event Timeline
Log In to Comment