diff --git a/CHANGES b/CHANGES index 763cca3c..9b0008db 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ ?? ??? 2007 - 2.5.0-trunk ------------------------- + * Added ability to compile without an external API (-DNO_MODSEC_API). + * Added "logdata" meta action to allow safe logging of raw transaction data. * Added TX_SEVERITY that keeps track of the highest severity diff --git a/apache2/Makefile b/apache2/Makefile index f66b4483..1a0a3b07 100644 --- a/apache2/Makefile +++ b/apache2/Makefile @@ -30,7 +30,8 @@ APACHECTL = apachectl INCLUDES = -I /usr/include/libxml2 #DEFS = -DWITH_LIBXML2 #DEFS = -DWITH_LIBXML2 -DDEBUG_CONF -DEFS = -DWITH_LIBXML2 -DCACHE_DEBUG +#DEFS = -DWITH_LIBXML2 -DCACHE_DEBUG +DEFS = -DWITH_LIBXML2 -DNO_MODSEC_API #LIBS = -Lmy/lib/dir -lmylib CFLAGS = -O2 -g -Wuninitialized -Wall -Wmissing-prototypes -Wshadow -Wunused-variable -Wunused-value -Wchar-subscripts -Wsign-compare diff --git a/apache2/apache2.h b/apache2/apache2.h index 1f3e9571..0ac84ef1 100644 --- a/apache2/apache2.h +++ b/apache2/apache2.h @@ -18,6 +18,7 @@ #include +#ifdef NO_MODSEC_API /* Optional functions. */ APR_DECLARE_OPTIONAL_FN(void, modsec_register_tfn, (const char *name, void *fn)); @@ -27,6 +28,7 @@ APR_DECLARE_OPTIONAL_FN(void, modsec_register_variable, unsigned int argc_min, unsigned int argc_max, void *fn_validate, void *fn_generate, unsigned int is_cacheable, unsigned int availability)); +#endif /* Configuration functions. */ diff --git a/apache2/mod_security2.c b/apache2/mod_security2.c index 720f337f..23156d56 100644 --- a/apache2/mod_security2.c +++ b/apache2/mod_security2.c @@ -972,6 +972,7 @@ static void hook_insert_error_filter(request_rec *r) { } #endif +#ifdef NO_MODSEC_API /** * This function is exported for other Apache modules to * register new transformation functions. @@ -1007,6 +1008,7 @@ static void modsec_register_variable(const char *name, unsigned int type, fprintf(stderr,"modsecurity is NULL\n"); } } +#endif /** * Registers module hooks with Apache. @@ -1031,10 +1033,12 @@ static void register_hooks(apr_pool_t *mp) { NULL }; +#ifdef NO_MODSEC_API /* Export optional functions. */ APR_REGISTER_OPTIONAL_FN(modsec_register_tfn); APR_REGISTER_OPTIONAL_FN(modsec_register_operator); APR_REGISTER_OPTIONAL_FN(modsec_register_variable); +#endif /* Main hooks */ ap_hook_pre_config(hook_pre_config, NULL, NULL, APR_HOOK_FIRST);