mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-14 05:45:59 +03:00
Make libxml2 *required*.
This commit is contained in:
parent
6974a1c781
commit
4e7c243c39
@ -39,13 +39,12 @@ APACHECTL = apachectl
|
|||||||
|
|
||||||
INCLUDES = -I /usr/include/libxml2 -I /usr/include/lua5.1
|
INCLUDES = -I /usr/include/libxml2 -I /usr/include/lua5.1
|
||||||
# INCLUDES = -I /usr/include/libxml2 -I /path/to/httpd-x.y/srclib/pcre
|
# INCLUDES = -I /usr/include/libxml2 -I /path/to/httpd-x.y/srclib/pcre
|
||||||
DEFS = -DWITH_LIBXML2 -DWITH_LUA
|
DEFS = -DWITH_LUA
|
||||||
# DEFS = -DWITH_ICONV
|
# DEFS = -DWITH_ICONV
|
||||||
#
|
# DEFS = -DPERFORMANCE_MEASUREMENT
|
||||||
# DEFS = -DWITH_LIBXML2 -DPERFORMANCE_MEASUREMENT
|
# DEFS = -DNO_MODSEC_API
|
||||||
# DEFS = -DWITH_LIBXML2 -DNO_MODSEC_API
|
# DEFS = -DDEBUG_CONF
|
||||||
# DEFS = -DWITH_LIBXML2 -DDEBUG_CONF
|
# DEFS = -DCACHE_DEBUG
|
||||||
# DEFS = -DWITH_LIBXML2 -DCACHE_DEBUG
|
|
||||||
# LIBS = -Lmy/lib/dir -lmylib
|
# LIBS = -Lmy/lib/dir -lmylib
|
||||||
|
|
||||||
CFLAGS = -O2 -g -Wuninitialized -Wall -Wmissing-prototypes -Wshadow -Wunused-variable -Wunused-value -Wchar-subscripts -Wsign-compare
|
CFLAGS = -O2 -g -Wuninitialized -Wall -Wmissing-prototypes -Wshadow -Wunused-variable -Wunused-value -Wchar-subscripts -Wsign-compare
|
||||||
|
@ -4,7 +4,6 @@ BASE = "C:/Program Files/Apache Group/Apache2/"
|
|||||||
|
|
||||||
CC = cl
|
CC = cl
|
||||||
|
|
||||||
# Add -DWITH_LIBXML2 below if you want to link against libxml2
|
|
||||||
DEFS = /nologo /Od /LD /W3 -DWIN32 -DWINNT
|
DEFS = /nologo /Od /LD /W3 -DWIN32 -DWINNT
|
||||||
DLL = mod_security2.dll
|
DLL = mod_security2.dll
|
||||||
|
|
||||||
|
@ -163,10 +163,8 @@ static apr_status_t modsecurity_tx_cleanup(void *data) {
|
|||||||
/* Multipart processor cleanup. */
|
/* Multipart processor cleanup. */
|
||||||
if (msr->mpd != NULL) multipart_cleanup(msr);
|
if (msr->mpd != NULL) multipart_cleanup(msr);
|
||||||
|
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
/* XML processor cleanup. */
|
/* XML processor cleanup. */
|
||||||
if (msr->xml != NULL) xml_cleanup(msr);
|
if (msr->xml != NULL) xml_cleanup(msr);
|
||||||
#endif
|
|
||||||
|
|
||||||
// TODO: Why do we ignore return code here?
|
// TODO: Why do we ignore return code here?
|
||||||
modsecurity_request_body_clear(msr, &my_error_msg);
|
modsecurity_request_body_clear(msr, &my_error_msg);
|
||||||
|
@ -41,9 +41,7 @@ typedef struct msc_string msc_string;
|
|||||||
#include "msc_multipart.h"
|
#include "msc_multipart.h"
|
||||||
#include "msc_pcre.h"
|
#include "msc_pcre.h"
|
||||||
#include "msc_util.h"
|
#include "msc_util.h"
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
#include "msc_xml.h"
|
#include "msc_xml.h"
|
||||||
#endif
|
|
||||||
#include "msc_geo.h"
|
#include "msc_geo.h"
|
||||||
#include "re.h"
|
#include "re.h"
|
||||||
|
|
||||||
@ -320,9 +318,7 @@ struct modsec_rec {
|
|||||||
|
|
||||||
multipart_data *mpd; /* MULTIPART processor data structure */
|
multipart_data *mpd; /* MULTIPART processor data structure */
|
||||||
|
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
xml_data *xml; /* XML processor data structure */
|
xml_data *xml; /* XML processor data structure */
|
||||||
#endif
|
|
||||||
|
|
||||||
/* audit logging */
|
/* audit logging */
|
||||||
char *new_auditlog_boundary;
|
char *new_auditlog_boundary;
|
||||||
|
@ -78,7 +78,6 @@ apr_status_t modsecurity_request_body_start(modsec_rec *msr, char **error_msg) {
|
|||||||
msr_log(msr, 2, "Multipart parser init failed: %s", my_error_msg);
|
msr_log(msr, 2, "Multipart parser init failed: %s", my_error_msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
else
|
else
|
||||||
if (strcmp(msr->msc_reqbody_processor, "XML") == 0) {
|
if (strcmp(msr->msc_reqbody_processor, "XML") == 0) {
|
||||||
if (xml_init(msr, &my_error_msg) < 0) {
|
if (xml_init(msr, &my_error_msg) < 0) {
|
||||||
@ -88,7 +87,6 @@ apr_status_t modsecurity_request_body_start(modsec_rec *msr, char **error_msg) {
|
|||||||
msr_log(msr, 2, "Multipart parser init failed: %s", my_error_msg);
|
msr_log(msr, 2, "Multipart parser init failed: %s", my_error_msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else
|
else
|
||||||
if (strcmp(msr->msc_reqbody_processor, "URLENCODED") == 0) {
|
if (strcmp(msr->msc_reqbody_processor, "URLENCODED") == 0) {
|
||||||
/* Do nothing, URLENCODED processor does not support streaming yet. */
|
/* Do nothing, URLENCODED processor does not support streaming yet. */
|
||||||
@ -274,7 +272,6 @@ apr_status_t modsecurity_request_body_store(modsec_rec *msr,
|
|||||||
msr_log(msr, 2, "Request body processor error: %s", my_error_msg);
|
msr_log(msr, 2, "Request body processor error: %s", my_error_msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
else
|
else
|
||||||
if (strcmp(msr->msc_reqbody_processor, "XML") == 0) {
|
if (strcmp(msr->msc_reqbody_processor, "XML") == 0) {
|
||||||
/* Increase per-request data length counter. */
|
/* Increase per-request data length counter. */
|
||||||
@ -288,7 +285,6 @@ apr_status_t modsecurity_request_body_store(modsec_rec *msr,
|
|||||||
msr_log(msr, 2, "Request body processor error: %s", my_error_msg);
|
msr_log(msr, 2, "Request body processor error: %s", my_error_msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
else
|
else
|
||||||
if (strcmp(msr->msc_reqbody_processor, "URLENCODED") == 0) {
|
if (strcmp(msr->msc_reqbody_processor, "URLENCODED") == 0) {
|
||||||
/* Increase per-request data length counter. */
|
/* Increase per-request data length counter. */
|
||||||
@ -437,7 +433,6 @@ apr_status_t modsecurity_request_body_end(modsec_rec *msr, char **error_msg) {
|
|||||||
if (strcmp(msr->msc_reqbody_processor, "URLENCODED") == 0) {
|
if (strcmp(msr->msc_reqbody_processor, "URLENCODED") == 0) {
|
||||||
return modsecurity_request_body_end_urlencoded(msr, error_msg);
|
return modsecurity_request_body_end_urlencoded(msr, error_msg);
|
||||||
}
|
}
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
else
|
else
|
||||||
if (strcmp(msr->msc_reqbody_processor, "XML") == 0) {
|
if (strcmp(msr->msc_reqbody_processor, "XML") == 0) {
|
||||||
if (xml_complete(msr, &my_error_msg) < 0) {
|
if (xml_complete(msr, &my_error_msg) < 0) {
|
||||||
@ -447,7 +442,6 @@ apr_status_t modsecurity_request_body_end(modsec_rec *msr, char **error_msg) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Note the request body no files length. */
|
/* Note the request body no files length. */
|
||||||
|
@ -8,8 +8,6 @@
|
|||||||
* write to Breach Security, Inc. at support@breach.com.
|
* write to Breach Security, Inc. at support@breach.com.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
|
|
||||||
#include "msc_xml.h"
|
#include "msc_xml.h"
|
||||||
|
|
||||||
|
|
||||||
@ -131,5 +129,3 @@ apr_status_t xml_cleanup(modsec_rec *msr) {
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -818,8 +818,6 @@ static int msre_op_m_execute(modsec_rec *msr, msre_rule *rule, msre_var *var, ch
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
|
|
||||||
/* validateDTD */
|
/* validateDTD */
|
||||||
|
|
||||||
static int msre_op_validateDTD_init(msre_rule *rule, char **error_msg) {
|
static int msre_op_validateDTD_init(msre_rule *rule, char **error_msg) {
|
||||||
@ -1100,8 +1098,6 @@ static int msre_op_verifyCC_execute(modsec_rec *msr, msre_rule *rule, msre_var *
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Perform geograpical lookups on an IP/Host.
|
* Perform geograpical lookups on an IP/Host.
|
||||||
*/
|
*/
|
||||||
@ -1833,8 +1829,6 @@ void msre_engine_register_default_operators(msre_engine *engine) {
|
|||||||
msre_op_m_execute
|
msre_op_m_execute
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
|
|
||||||
/* validateDTD */
|
/* validateDTD */
|
||||||
msre_engine_op_register(engine,
|
msre_engine_op_register(engine,
|
||||||
"validateDTD",
|
"validateDTD",
|
||||||
@ -1849,8 +1843,6 @@ void msre_engine_register_default_operators(msre_engine *engine) {
|
|||||||
msre_op_validateSchema_execute
|
msre_op_validateSchema_execute
|
||||||
);
|
);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* verifyCC */
|
/* verifyCC */
|
||||||
msre_engine_op_register(engine,
|
msre_engine_op_register(engine,
|
||||||
"verifyCC",
|
"verifyCC",
|
||||||
|
@ -15,9 +15,7 @@
|
|||||||
#include "re.h"
|
#include "re.h"
|
||||||
#include "msc_util.h"
|
#include "msc_util.h"
|
||||||
|
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
#include "libxml/xpathInternals.h"
|
#include "libxml/xpathInternals.h"
|
||||||
#endif
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generates a variable from a string and a length.
|
* Generates a variable from a string and a length.
|
||||||
@ -513,8 +511,6 @@ static int var_reqbody_processor_error_msg_generate(modsec_rec *msr, msre_var *v
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
|
|
||||||
/* XML */
|
/* XML */
|
||||||
|
|
||||||
static char *var_xml_validate(msre_ruleset *ruleset, msre_var *var) {
|
static char *var_xml_validate(msre_ruleset *ruleset, msre_var *var) {
|
||||||
@ -630,7 +626,6 @@ static int var_xml_generate(modsec_rec *msr, msre_var *var, msre_rule *rule,
|
|||||||
|
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/* WEBSERVER_ERROR_LOG */
|
/* WEBSERVER_ERROR_LOG */
|
||||||
|
|
||||||
@ -3097,7 +3092,6 @@ void msre_engine_register_default_variables(msre_engine *engine) {
|
|||||||
PHASE_REQUEST_HEADERS
|
PHASE_REQUEST_HEADERS
|
||||||
);
|
);
|
||||||
|
|
||||||
#ifdef WITH_LIBXML2
|
|
||||||
/* XML */
|
/* XML */
|
||||||
msre_engine_variable_register(engine,
|
msre_engine_variable_register(engine,
|
||||||
"XML",
|
"XML",
|
||||||
@ -3108,5 +3102,4 @@ void msre_engine_register_default_variables(msre_engine *engine) {
|
|||||||
VAR_CACHE,
|
VAR_CACHE,
|
||||||
PHASE_REQUEST_BODY
|
PHASE_REQUEST_BODY
|
||||||
);
|
);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
@ -339,7 +339,7 @@
|
|||||||
</listitem>
|
</listitem>
|
||||||
|
|
||||||
<listitem>
|
<listitem>
|
||||||
<para>(Optional) Add one line to your configuration to load libxml2:
|
<para>Add one line to your configuration to load libxml2:
|
||||||
<filename moreinfo="none">LoadFile
|
<filename moreinfo="none">LoadFile
|
||||||
/usr/lib/libxml2.so</filename></para>
|
/usr/lib/libxml2.so</filename></para>
|
||||||
</listitem>
|
</listitem>
|
||||||
@ -5269,4 +5269,4 @@ SecRule REQUEST_METHOD "!<emphasis>@within %{tx.allowed_methods}</emphasis>" t:l
|
|||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
</article>
|
</article>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user