diff options
| author | 2004-07-16 01:33:59 +0000 | |
|---|---|---|
| committer | 2004-07-16 01:33:59 +0000 | |
| commit | 197e405e8e8ae8e11bb251305043810c7fa93e4e (patch) | |
| tree | c601e247a7073c6385cf739d96de7399c31b5feb | |
| parent | 21122f1bb734aa00fc14564d801ea9dc4804c793 (diff) | |
fixed another segfault related to the mysql escaping function (forcepreserve bug)
included win32 build bat files in distribution
separated -Werror to a configure time option (--enable-maintainer)
update autogen to use autoconf 2.57, aclocal 1.7
included pgsql and dbi module source in distribution.
setup autodetection in configure script for databases.
| -rw-r--r-- | CHANGELOG | 10 | ||||
| -rw-r--r-- | Makefile.in | 51 | ||||
| -rwxr-xr-x | autogen.sh | 6 | ||||
| -rw-r--r-- | configure.ac | 54 | ||||
| -rw-r--r-- | mod_log_sql.c | 10 | ||||
| -rw-r--r-- | mod_log_sql.h | 2 | ||||
| -rw-r--r-- | mod_log_sql_mysql.c | 1 |
7 files changed, 85 insertions, 49 deletions
| @@ -1,9 +1,13 @@ | |||
| 1 | ?: ? | 1 | 1.99: 2004-06-10 |
| 2 | * Added DBI support | 2 | * Added DBI support (not completed yet) |
| 3 | * fixed segfault in the mysql driver escape_string function | 3 | * fixed segfault in the mysql driver escape_string function |
| 4 | * fixed segfault when forcepreserve is set on. | ||
| 4 | * switched escape_string driver function to include the string quotes. | 5 | * switched escape_string driver function to include the string quotes. |
| 6 | * On Database connection failure Database errors are printed at ERR loglevel | ||
| 7 | instead of debug | ||
| 8 | * forgot to include build-apache(13|2).bat scripts in the distribution | ||
| 5 | 9 | ||
| 6 | 1.98: 2004-04-12 | 10 | 1.98: 2004-05-12 |
| 7 | * re-fixed apache.m4 to better detect APR and APU code | 11 | * re-fixed apache.m4 to better detect APR and APU code |
| 8 | * fixed for win32 compilation under apache 2 | 12 | * fixed for win32 compilation under apache 2 |
| 9 | * lowered minumum required apache 2 version to 2.0.40 (RH9) | 13 | * lowered minumum required apache 2 version to 2.0.40 (RH9) |
diff --git a/Makefile.in b/Makefile.in index 5b4f368..7e7ae94 100644 --- a/Makefile.in +++ b/Makefile.in | |||
| @@ -2,7 +2,6 @@ | |||
| 2 | 2 | ||
| 3 | # Modify these top variables. | 3 | # Modify these top variables. |
| 4 | SUBDIRS = docs contrib | 4 | SUBDIRS = docs contrib |
| 5 | SOURCES = @PACKAGE_NAME@.c | ||
| 6 | 5 | ||
| 7 | HEADERS = mod_log_sql.h \ | 6 | HEADERS = mod_log_sql.h \ |
| 8 | functions.h \ | 7 | functions.h \ |
| @@ -11,15 +10,21 @@ HEADERS = mod_log_sql.h \ | |||
| 11 | apache13.h \ | 10 | apache13.h \ |
| 12 | apache20.h | 11 | apache20.h |
| 13 | 12 | ||
| 14 | CFLAGS = -Wc,-Wall -Wc,-Werror -Wc,-fno-strict-aliasing | 13 | CFLAGS = -Wc,-Wall -Wc,-fno-strict-aliasing |
| 15 | 14 | ||
| 16 | LDADD = @RT_LIBS@ | 15 | ifeq (@OOO_MAINTAIN@,1) |
| 17 | 16 | CFLAGS += -Wc,-Werror | |
| 18 | EXTRA_DIST = AUTHORS INSTALL TODO LICENSE CHANGELOG | 17 | endif |
| 19 | 18 | ||
| 20 | TARGET = @PACKAGE_NAME@@APXS_EXTENSION@ | 19 | EXTRA_DIST = AUTHORS INSTALL TODO LICENSE CHANGELOG \ |
| 20 | build-apache13.bat build-apache2.bat | ||
| 21 | 21 | ||
| 22 | TARGETS = $(TARGET) | 22 | coreSOURCES = @PACKAGE_NAME@.c |
| 23 | coreTARGET = @PACKAGE_NAME@@APXS_EXTENSION@ | ||
| 24 | coreLDADD = @RT_LIBS@ | ||
| 25 | coreCFLAGS = | ||
| 26 | coreNAME = log_sql | ||
| 27 | TARGETS = $(coreTARGET) | ||
| 23 | 28 | ||
| 24 | sslSOURCES = @PACKAGE_NAME@_ssl.c | 29 | sslSOURCES = @PACKAGE_NAME@_ssl.c |
| 25 | sslTARGET = @PACKAGE_NAME@_ssl@APXS_EXTENSION@ | 30 | sslTARGET = @PACKAGE_NAME@_ssl@APXS_EXTENSION@ |
| @@ -68,11 +73,14 @@ PROVIDERS_SUBDIRS = @subdirs@ | |||
| 68 | srcdir = @abs_srcdir@ | 73 | srcdir = @abs_srcdir@ |
| 69 | builddir = @abs_builddir@ | 74 | builddir = @abs_builddir@ |
| 70 | 75 | ||
| 71 | OBJ = $(SOURCES:.c=.o) $(sslSOURCES:.c=.o) $(mysqlSOURCES:.c=.o) | 76 | OBJ = $(SOURCES:.c=.o) $(sslSOURCES:.c=.o) $(mysqlSOURCES:.c=.o) \ |
| 77 | $(dbiSOURCES:.c=.o) $(pgsqlSOURCES:.c=.o) | ||
| 72 | 78 | ||
| 73 | LO = $(SOURCES:.c=.lo) $(sslSOURCES:.c=.lo) $(mysqlSOURCES:.c=.lo) | 79 | LO = $(SOURCES:.c=.lo) $(sslSOURCES:.c=.lo) $(mysqlSOURCES:.c=.lo) \ |
| 80 | $(dbiSOURCES:.c=.lo) $(pgsqlSOURCES:.c=.lo) | ||
| 74 | 81 | ||
| 75 | SLO = $(SOURCES:.c=.slo) $(sslSOURCES:.c=.slo) $(mysqlSOURCES:.c=.slo) | 82 | SLO = $(SOURCES:.c=.slo) $(sslSOURCES:.c=.slo) $(mysqlSOURCES:.c=.slo) \ |
| 83 | $(dbiSOURCES:.c=.slo) $(pgsqlSOURCES:.c=.slo) | ||
| 76 | 84 | ||
| 77 | STD_DIST = install-sh \ | 85 | STD_DIST = install-sh \ |
| 78 | config.sub \ | 86 | config.sub \ |
| @@ -84,8 +92,8 @@ STD_DIST = install-sh \ | |||
| 84 | stamp-h.in \ | 92 | stamp-h.in \ |
| 85 | config.h.in | 93 | config.h.in |
| 86 | 94 | ||
| 87 | DISTFILES = $(STD_DIST) $(EXTRA_DIST) $(SOURCES) $(HEADERS) \ | 95 | DISTFILES = $(STD_DIST) $(EXTRA_DIST) $(coreSOURCES) $(HEADERS) \ |
| 88 | $(sslSOURCES) $(mysqlSOURCES) | 96 | $(sslSOURCES) $(mysqlSOURCES) $(pgsqlSOURCES) $(dbsqlSOURCES) |
| 89 | 97 | ||
| 90 | all: $(TARGETS) all-subdirs | 98 | all: $(TARGETS) all-subdirs |
| 91 | 99 | ||
| @@ -107,9 +115,9 @@ all-subdirs install-subdirs activate-subdirs clean-subdirs distclean-subdirs: | |||
| 107 | TODO: TODO.in | 115 | TODO: TODO.in |
| 108 | @./gen_todo.pl | 116 | @./gen_todo.pl |
| 109 | 117 | ||
| 110 | $(TARGET): $(SOURCES) $(HEADERS) | 118 | $(coreTARGET): $(coreSOURCES) $(HEADERS) |
| 111 | @@APXS_BIN@ -c -o $(TARGET) $(CFLAGS) \ | 119 | @@APXS_BIN@ -c -o $(coreTARGET) $(coreCFLAGS) $(CFLAGS) \ |
| 112 | @DEFS@ @AP_DEFS@ $(LDADD) $(SOURCES) | 120 | @DEFS@ @AP_DEFS@ $(coreLDADD) $(coreSOURCES) |
| 113 | 121 | ||
| 114 | $(sslTARGET): $(sslSOURCES) $(HEADERS) | 122 | $(sslTARGET): $(sslSOURCES) $(HEADERS) |
| 115 | @@APXS_BIN@ -c -o $(sslTARGET) $(sslCFLAGS) $(CFLAGS) \ | 123 | @@APXS_BIN@ -c -o $(sslTARGET) $(sslCFLAGS) $(CFLAGS) \ |
| @@ -128,8 +136,13 @@ $(dbiTARGET): $(dbiSOURCES) $(HEADERS) | |||
| 128 | @DEFS@ @AP_DEFS@ $(dbiLDADD) $(dbiSOURCES) | 136 | @DEFS@ @AP_DEFS@ $(dbiLDADD) $(dbiSOURCES) |
| 129 | 137 | ||
| 130 | install: $(TARGETS) install-subdirs | 138 | install: $(TARGETS) install-subdirs |
| 131 | @@APXS_BIN@ -i $(TARGET); \ | 139 | @@APXS_BIN@ -n $(coreNAME) -i $(coreTARGET); \ |
| 132 | @APXS_BIN@ -n $(mysqlNAME) -i $(mysqlTARGET); \ | 140 | if test @WANT_MYSQL_MOD@ -eq 1; then \ |
| 141 | @APXS_BIN@ -n $(mysqlNAME) -i $(mysqlTARGET); \ | ||
| 142 | fi; \ | ||
| 143 | if test @WANT_PGSQL_MOD@ -eq 1; then \ | ||
| 144 | @APXS_BIN@ -n $(pgsqlNAME) -i $(pgsqlTARGET); \ | ||
| 145 | fi; \ | ||
| 133 | if test @WANT_DBI_MOD@ -eq 1; then \ | 146 | if test @WANT_DBI_MOD@ -eq 1; then \ |
| 134 | @APXS_BIN@ -n $(dbiNAME) -i $(dbiTARGET); \ | 147 | @APXS_BIN@ -n $(dbiNAME) -i $(dbiTARGET); \ |
| 135 | fi; \ | 148 | fi; \ |
| @@ -152,9 +165,9 @@ install: $(TARGETS) install-subdirs | |||
| 152 | echo "*************************************************************************"; | 165 | echo "*************************************************************************"; |
| 153 | 166 | ||
| 154 | activate: activate-subdirs | 167 | activate: activate-subdirs |
| 155 | @@APXS_BIN@ -i -a $(TARGET); \ | 168 | @@APXS_BIN@ -n $(coreNAME) -i -a $(coreTARGET); \ |
| 156 | if test @WANT_SSL_MOD@ -eq 1; then \ | 169 | if test @WANT_SSL_MOD@ -eq 1; then \ |
| 157 | @APXS_BIN@ -i -a $(sslTARGET); \ | 170 | @APXS_BIN@ -n $(sslNAME) -i -a $(sslTARGET); \ |
| 158 | fi | 171 | fi |
| 159 | 172 | ||
| 160 | clean: clean-subdirs | 173 | clean: clean-subdirs |
| @@ -1,13 +1,13 @@ | |||
| 1 | #!/bin/sh | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | if [ -z $ACLOCAL ]; then | 3 | if [ -z $ACLOCAL ]; then |
| 4 | ACLOCAL=aclocal-1.5 | 4 | ACLOCAL=aclocal-1.7 |
| 5 | fi | 5 | fi |
| 6 | if [ -z $AUTOCONF ]; then | 6 | if [ -z $AUTOCONF ]; then |
| 7 | AUTOCONF=autoconf-2.53 | 7 | AUTOCONF=autoconf-2.57 |
| 8 | fi | 8 | fi |
| 9 | if [ -z $AUTOHEADER ]; then | 9 | if [ -z $AUTOHEADER ]; then |
| 10 | AUTOHEADER=autoheader-2.53 | 10 | AUTOHEADER=autoheader-2.57 |
| 11 | fi | 11 | fi |
| 12 | rm -rf autom4te-2.53.cache | 12 | rm -rf autom4te-2.53.cache |
| 13 | $ACLOCAL -I m4 | 13 | $ACLOCAL -I m4 |
diff --git a/configure.ac b/configure.ac index d10ad4f..f2c0df2 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -6,6 +6,8 @@ AC_CONFIG_HEADERS(config.h) | |||
| 6 | 6 | ||
| 7 | AC_CONFIG_SRCDIR(mod_log_sql.c) | 7 | AC_CONFIG_SRCDIR(mod_log_sql.c) |
| 8 | 8 | ||
| 9 | OOO_MAINTAIN_MODE | ||
| 10 | |||
| 9 | dnl Add a test for a compiler. | 11 | dnl Add a test for a compiler. |
| 10 | AC_PROG_CC | 12 | AC_PROG_CC |
| 11 | 13 | ||
| @@ -19,31 +21,31 @@ CHECK_APACHE($APACHE13_VERSION,$APACHE20_VERSION, | |||
| 19 | AC_MSG_ERROR([*** or Apache 2.0/2.1 version $APACHE20_VERSION or greater!]) | 21 | AC_MSG_ERROR([*** or Apache 2.0/2.1 version $APACHE20_VERSION or greater!]) |
| 20 | ) | 22 | ) |
| 21 | 23 | ||
| 22 | CHECK_PATH_MYSQL(:, | 24 | CHECK_PATH_MYSQL( |
| 25 | WANT_MYSQL_MOD=1, | ||
| 23 | AC_MSG_ERROR([*** Mysql client libraries not found!]) | 26 | AC_MSG_ERROR([*** Mysql client libraries not found!]) |
| 27 | WANT_MYSQL_MOD=0 | ||
| 24 | ) | 28 | ) |
| 29 | AC_SUBST(WANT_MYSQL_MOD) | ||
| 30 | |||
| 31 | CHECK_PATH_LIBDBI(WANT_DBI_MOD=1, | ||
| 32 | AC_MSG_ERROR([** libDBI client libraries not found!]) | ||
| 33 | WANT_DBI_MOD=0 | ||
| 34 | ) | ||
| 35 | AC_SUBST(WANT_DBI_MOD) | ||
| 36 | |||
| 37 | dnl to write, checking for pgsql libs | ||
| 38 | WANT_PGSQL_MOD=0 | ||
| 39 | AC_SUBST(WANT_PGSQL_MOD) | ||
| 40 | |||
| 25 | 41 | ||
| 26 | CHECK_PATH_MOD_SSL( | 42 | CHECK_PATH_MOD_SSL( |
| 27 | AC_DEFINE(WANT_SSL_LOGGING,,[Define if we want to compile in SSL support.]) | 43 | AC_DEFINE(WANT_SSL_LOGGING,,[Define if we want to compile in SSL support.]) |
| 28 | WANT_SSL_MOD=1, | 44 | WANT_SSL_MOD=1, |
| 29 | WANT_SSL_MOD=0 | 45 | WANT_SSL_MOD=0 |
| 30 | ) | 46 | ) |
| 31 | |||
| 32 | AC_SUBST(WANT_SSL_MOD) | 47 | AC_SUBST(WANT_SSL_MOD) |
| 33 | 48 | ||
| 34 | WANT_MYSQL_MOD=1 | ||
| 35 | AC_SUBST(WANT_MYSQL_MOD) | ||
| 36 | WANT_PGSQL_MOD=0 | ||
| 37 | AC_SUBST(WANT_PGSQL_MOD) | ||
| 38 | WANT_DBI_MOD=1 | ||
| 39 | DBI_LDFLAGS="" | ||
| 40 | DBI_LIBS="-ldbi" | ||
| 41 | DBI_CFLAGS="" | ||
| 42 | AC_SUBST(DBI_LDFLAGS) | ||
| 43 | AC_SUBST(DBI_LIBS) | ||
| 44 | AC_SUBST(DBI_CFLAGS) | ||
| 45 | AC_SUBST(WANT_DBI_MOD) | ||
| 46 | |||
| 47 | case "$target" in | 49 | case "$target" in |
| 48 | *-*-solaris* | *-*-osf* ) | 50 | *-*-solaris* | *-*-osf* ) |
| 49 | if test $APACHE_VERSION -eq 1.3; then | 51 | if test $APACHE_VERSION -eq 1.3; then |
| @@ -70,10 +72,24 @@ contrib/Makefile) | |||
| 70 | 72 | ||
| 71 | 73 | ||
| 72 | AC_MSG_RESULT([------------------------------------]) | 74 | AC_MSG_RESULT([------------------------------------]) |
| 73 | AC_MSG_RESULT([Apache version : $AP_VERSION]) | 75 | AC_MSG_RESULT([Apache version : $AP_VERSION]) |
| 74 | if test $WANT_SSL_MOD -eq 1; then | 76 | if test $WANT_SSL_MOD -eq 1; then |
| 75 | AC_MSG_RESULT([SSL Support : yes]) | 77 | AC_MSG_RESULT([SSL Support : yes]) |
| 76 | else | 78 | else |
| 77 | AC_MSG_RESULT([SSL Support : no]) | 79 | AC_MSG_RESULT([SSL Support : no]) |
| 78 | AC_MSG_RESULT([*** Use --enable-ssl to enable SSL support]) | 80 | AC_MSG_RESULT([*** Use --enable-ssl to enable SSL support]) |
| 81 | fi | ||
| 82 | AC_MSG_RESULT([Enabled drivers :]) | ||
| 83 | if test $WANT_MYSQL_MOD -eq 1; then | ||
| 84 | AC_MSG_RESULT([ MySQL Driver]) | ||
| 79 | fi | 85 | fi |
| 86 | if test $WANT_PGSQL_MOD -eq 1; then | ||
| 87 | AC_MSG_RESULT([ PostgreSQL Driver]) | ||
| 88 | fi | ||
| 89 | if test $WANT_DBI_MOD -eq 1; then | ||
| 90 | AC_MSG_RESULT([ libDBI Driver]) | ||
| 91 | fi | ||
| 92 | if test $OOO_MAINTAIN -eq 1; then | ||
| 93 | AC_MSG_RESULT([Maintainer mode is on. -Werror is in effect]) | ||
| 94 | fi | ||
| 95 | AC_MSG_RESULT([------------------------------------]) | ||
diff --git a/mod_log_sql.c b/mod_log_sql.c index dace2d4..7aaa595 100644 --- a/mod_log_sql.c +++ b/mod_log_sql.c | |||
| @@ -154,7 +154,7 @@ static logsql_opendb_ret log_sql_opendb_link(server_rec* s) | |||
| 154 | { | 154 | { |
| 155 | logsql_opendb_ret result; | 155 | logsql_opendb_ret result; |
| 156 | if (global_config.forcepreserve) { | 156 | if (global_config.forcepreserve) { |
| 157 | global_config.db.connected = 1; | 157 | //global_config.db.connected = 1; |
| 158 | return LOGSQL_OPENDB_PRESERVE; | 158 | return LOGSQL_OPENDB_PRESERVE; |
| 159 | } | 159 | } |
| 160 | if (global_config.db.connected) { | 160 | if (global_config.db.connected) { |
| @@ -1054,10 +1054,10 @@ static int log_sql_transaction(request_rec *orig) | |||
| 1054 | 1054 | ||
| 1055 | /* How's our mysql link integrity? */ | 1055 | /* How's our mysql link integrity? */ |
| 1056 | if (!global_config.db.connected) { | 1056 | if (!global_config.db.connected) { |
| 1057 | 1057 | if (!global_config.forcepreserve) { | |
| 1058 | /* Make a try to establish the link */ | 1058 | /* Make a try to establish the link */ |
| 1059 | log_sql_opendb_link(r->server); | 1059 | log_sql_opendb_link(r->server); |
| 1060 | 1060 | } | |
| 1061 | if (!global_config.db.connected) { | 1061 | if (!global_config.db.connected) { |
| 1062 | /* Unable to re-establish a DB link, so assume that it's really | 1062 | /* Unable to re-establish a DB link, so assume that it's really |
| 1063 | * gone and send the entry to the preserve file instead. | 1063 | * gone and send the entry to the preserve file instead. |
diff --git a/mod_log_sql.h b/mod_log_sql.h index e708f57..6bcd6cb 100644 --- a/mod_log_sql.h +++ b/mod_log_sql.h | |||
| @@ -79,6 +79,8 @@ typedef enum { | |||
| 79 | /* Registration function for database drivers */ | 79 | /* Registration function for database drivers */ |
| 80 | 80 | ||
| 81 | typedef struct { | 81 | typedef struct { |
| 82 | /* name of the provider */ | ||
| 83 | const char *providername; | ||
| 82 | /* NULL terminated list of drivers strings */ | 84 | /* NULL terminated list of drivers strings */ |
| 83 | const char **provided_drivers; | 85 | const char **provided_drivers; |
| 84 | /* create a connection to the underlying database layer */ | 86 | /* create a connection to the underlying database layer */ |
diff --git a/mod_log_sql_mysql.c b/mod_log_sql_mysql.c index f058110..fd1668a 100644 --- a/mod_log_sql_mysql.c +++ b/mod_log_sql_mysql.c | |||
| @@ -247,6 +247,7 @@ static logsql_table_ret log_sql_mysql_create(request_rec *r, logsql_dbconnection | |||
| 247 | 247 | ||
| 248 | static const char *supported_drivers[] = {"mysql",NULL}; | 248 | static const char *supported_drivers[] = {"mysql",NULL}; |
| 249 | static logsql_dbdriver mysql_driver = { | 249 | static logsql_dbdriver mysql_driver = { |
| 250 | "mysql", | ||
| 250 | supported_drivers, | 251 | supported_drivers, |
| 251 | log_sql_mysql_connect, /* open DB connection */ | 252 | log_sql_mysql_connect, /* open DB connection */ |
| 252 | log_sql_mysql_close, /* close DB connection */ | 253 | log_sql_mysql_close, /* close DB connection */ |
