From c1d3fd63630d2738a5aef5bb6aec76c0228dc5e3 Mon Sep 17 00:00:00 2001 From: brenosilva Date: Wed, 20 Apr 2011 19:14:49 +0000 Subject: [PATCH] Applied patches from Diego --- Makefile.am | 2 +- apache2/msc_geo.c | 8 ++++---- apache2/msc_util.c | 2 +- apache2/re_operators.c | 2 +- configure.ac | 11 +---------- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/Makefile.am b/Makefile.am index a78c322a..407a5374 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,4 @@ -ACLOCAL_AMFLAGS = -I acinclude +ACLOCAL_AMFLAGS = -I build SUBDIRS = @TOPLEVEL_SUBDIRS@ tests # Alias for "check" diff --git a/apache2/msc_geo.c b/apache2/msc_geo.c index 6327f536..fa0f4377 100644 --- a/apache2/msc_geo.c +++ b/apache2/msc_geo.c @@ -17,7 +17,7 @@ /* -- Lookup Tables -- */ -static const char *geo_country_code[GEO_COUNTRY_LAST + 1] = { +static const char geo_country_code[GEO_COUNTRY_LAST + 1][4] = { "--", "AP","EU","AD","AE","AF","AG","AI","AL","AM","AN", "AO","AQ","AR","AS","AT","AU","AW","AZ","BA","BB", @@ -46,7 +46,7 @@ static const char *geo_country_code[GEO_COUNTRY_LAST + 1] = { "ZM","ME","ZW","A1","A2","O1","AX","GG","IM","JE" }; -static const char *geo_country_code3[GEO_COUNTRY_LAST + 1] = { +static const char geo_country_code3[GEO_COUNTRY_LAST + 1][4] = { "--", "AP","EU","AND","ARE","AFG","ATG","AIA","ALB","ARM","ANT", "AGO","AQ","ARG","ASM","AUT","AUS","ABW","AZE","BIH","BRB", @@ -75,7 +75,7 @@ static const char *geo_country_code3[GEO_COUNTRY_LAST + 1] = { "ZMB","MNE","ZWE","A1","A2","O1","ALA","GGY","IMN","JEY" }; -static const char *geo_country_name[GEO_COUNTRY_LAST + 1] = { +static const char *const geo_country_name[GEO_COUNTRY_LAST + 1] = { "N/A", "Asia/Pacific Region","Europe","Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Netherlands Antilles", "Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina","Barbados", @@ -104,7 +104,7 @@ static const char *geo_country_name[GEO_COUNTRY_LAST + 1] = { "Zambia","Montenegro","Zimbabwe","Anonymous Proxy","Satellite Provider","Other","Aland Islands","Guernsey","Isle of Man","Jersey" }; -static const char *geo_country_continent[GEO_COUNTRY_LAST + 1] = { +static const char geo_country_continent[GEO_COUNTRY_LAST + 1][4] = { "--", "AS","EU","EU","AS","AS","SA","SA","EU","AS","SA", "AF","AN","SA","OC","EU","OC","SA","AS","EU","SA", diff --git a/apache2/msc_util.c b/apache2/msc_util.c index f75fb8b8..6c67c1b7 100644 --- a/apache2/msc_util.c +++ b/apache2/msc_util.c @@ -434,7 +434,7 @@ int hex2bytes_inplace(unsigned char *data, int len) { * representation. */ char *bytes2hex(apr_pool_t *pool, unsigned char *data, int len) { - static unsigned char b2hex[] = "0123456789abcdef"; + static const unsigned char b2hex[] = "0123456789abcdef"; char *hex = NULL; int i, j; diff --git a/apache2/re_operators.c b/apache2/re_operators.c index 99f8b234..8d69b147 100644 --- a/apache2/re_operators.c +++ b/apache2/re_operators.c @@ -1861,7 +1861,7 @@ static int luhn_verify(const char *ccnumber, int len) { /* Weighted lookup table which is just a precalculated (i = index): * i*2 + (( (i*2) > 9 ) ? -9 : 0) */ - static int wtable[10] = {0, 2, 4, 6, 8, 1, 3, 5, 7, 9}; /* weight lookup table */ + static const int wtable[10] = {0, 2, 4, 6, 8, 1, 3, 5, 7, 9}; /* weight lookup table */ /* Add up only digits (weighted digits via lookup table) * for both odd and even CC numbers to avoid 2 passes. diff --git a/configure.ac b/configure.ac index c4b88364..7015de51 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ AC_PREREQ(2.63) AC_INIT([modsecurity], [2.6], [support@modsecurity.org]) -AC_CONFIG_MACRO_DIR([acinclude]) +AC_CONFIG_MACRO_DIR([build]) AC_CONFIG_SRCDIR([LICENSE]) AC_CONFIG_HEADERS([modsecurity_config_auto.h]) AC_CONFIG_AUX_DIR([build]) @@ -514,15 +514,6 @@ else fi fi -# Include M4 macros -sinclude(build/find_pcre.m4) -sinclude(build/find_apr.m4) -sinclude(build/find_apu.m4) -sinclude(build/find_xml.m4) -sinclude(build/find_lua.m4) -sinclude(build/find_curl.m4) - - ### Build *EXTRA_CFLAGS vars # Allow overriding EXTRA_CFLAGS