"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "apache2/mod_security2.c" between
modsecurity-2.9.6.tar.gz and modsecurity-2.9.7.tar.gz

About: ModSecurity is an intrusion detection and prevention module (web application firewall) for the Apache (and Nginx) Web servers.

mod_security2.c  (modsecurity-2.9.6):mod_security2.c  (modsecurity-2.9.7)
/* /*
* ModSecurity for Apache 2.x, http://www.modsecurity.org/ * ModSecurity for Apache 2.x, http://www.modsecurity.org/
* Copyright (c) 2004-2013 Trustwave Holdings, Inc. (http://www.trustwave.com/) * Copyright (c) 2004-2022 Trustwave Holdings, Inc. (http://www.trustwave.com/)
* *
* You may not use this file except in compliance with * You may not use this file except in compliance with
* the License.  You may obtain a copy of the License at * the License.  You may obtain a copy of the License at
* *
*     http://www.apache.org/licenses/LICENSE-2.0 *     http://www.apache.org/licenses/LICENSE-2.0
* *
* If any of the files related to licensing are missing or if you have any * If any of the files related to licensing are missing or if you have any
* other questions related to licensing please contact Trustwave Holdings, Inc. * other questions related to licensing please contact Trustwave Holdings, Inc.
* directly using the email address security@modsecurity.org. * directly using the email address security@modsecurity.org.
*/ */
skipping to change at line 28 skipping to change at line 28
#include "http_request.h" #include "http_request.h"
#include "modsecurity.h" #include "modsecurity.h"
#include "apache2.h" #include "apache2.h"
#include "http_main.h" #include "http_main.h"
#include "http_connection.h" #include "http_connection.h"
#include "apr_optional.h" #include "apr_optional.h"
#include "mod_log_config.h" #include "mod_log_config.h"
/*
* #ifdef APLOG_USE_MODULE
* APLOG_USE_MODULE(security2);
* #endif
*/
#include "msc_logging.h" #include "msc_logging.h"
#include "msc_util.h" #include "msc_util.h"
#include "ap_mpm.h" #include "ap_mpm.h"
#include "scoreboard.h" #include "scoreboard.h"
#include "apr_version.h" #include "apr_version.h"
#include "msc_remote_rules.h" #include "msc_remote_rules.h"
#if defined(WITH_LUA) #if defined(WITH_LUA)
#include "msc_lua.h" #include "msc_lua.h"
#endif #endif
#include "msc_status_engine.h" #include "msc_status_engine.h"
#ifdef WITH_YAJL #ifdef WITH_YAJL
#include <yajl/yajl_version.h> #include <yajl/yajl_version.h>
#endif /* WITH_YAJL */ #endif /* WITH_YAJL */
#ifdef APLOG_USE_MODULE
APLOG_USE_MODULE(security2);
#endif
/* ModSecurity structure */ /* ModSecurity structure */
msc_engine DSOLOCAL *modsecurity = NULL; msc_engine DSOLOCAL *modsecurity = NULL;
/* Global module variables; these are used for the Apache-specific functionality */ /* Global module variables; these are used for the Apache-specific functionality */
char DSOLOCAL *chroot_dir = NULL; char DSOLOCAL *chroot_dir = NULL;
char DSOLOCAL *new_server_signature = NULL; char DSOLOCAL *new_server_signature = NULL;
skipping to change at line 108 skipping to change at line 106
/* -- Miscellaneous functions -- */ /* -- Miscellaneous functions -- */
/** /**
* \brief Print informations from used libraries * \brief Print informations from used libraries
* *
* \param mp Pointer to memory pool * \param mp Pointer to memory pool
*/ */
static void version(apr_pool_t *mp) { static void version(apr_pool_t *mp) {
char *pcre_vrs = NULL; char *pcre_vrs = NULL;
const char *pcre_loaded_vrs = NULL;
char pcre2_loaded_vrs_buffer[80] ={0};
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
"ModSecurity: APR compiled version=\"%s\"; " "ModSecurity: APR compiled version=\"%s\"; "
"loaded version=\"%s\"", APR_VERSION_STRING, apr_version_string()); "loaded version=\"%s\"", APR_VERSION_STRING, apr_version_string());
if (strstr(apr_version_string(), APR_VERSION_STRING) == NULL) { if (strstr(apr_version_string(), APR_VERSION_STRING) == NULL) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, "ModSecurity: Loaded AP R do not match with compiled!"); ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, "ModSecurity: Loaded AP R do not match with compiled!");
} }
#ifdef WITH_PCRE2
pcre_vrs = apr_psprintf(mp,"%d.%d ", PCRE2_MAJOR, PCRE2_MINOR);
pcre_loaded_vrs = pcre2_loaded_vrs_buffer;
pcre2_config(PCRE2_CONFIG_VERSION, pcre2_loaded_vrs_buffer);
#else
pcre_vrs = apr_psprintf(mp,"%d.%d ", PCRE_MAJOR, PCRE_MINOR); pcre_vrs = apr_psprintf(mp,"%d.%d ", PCRE_MAJOR, PCRE_MINOR);
pcre_loaded_vrs = pcre_version();
#endif
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
#ifdef WITH_PCRE2
"ModSecurity: PCRE2 compiled version=\"%s\"; "
#else
"ModSecurity: PCRE compiled version=\"%s\"; " "ModSecurity: PCRE compiled version=\"%s\"; "
"loaded version=\"%s\"", pcre_vrs, pcre_version()); #endif
"loaded version=\"%s\"", pcre_vrs, pcre_loaded_vrs);
if (strstr(pcre_version(),pcre_vrs) == NULL) { if (strstr(pcre_loaded_vrs,pcre_vrs) == NULL) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, "ModSecurity: Loaded PC RE do not match with compiled!"); ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, "ModSecurity: Loaded PC RE do not match with compiled!");
} }
/* Lua version function was removed in current 5.1. Need to check in future versions if it's back */ /* Lua version function was removed in current 5.1. Need to check in future versions if it's back */
#if defined(WITH_LUA) #if defined(WITH_LUA)
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL, ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
"ModSecurity: LUA compiled version=\"%s\"", LUA_VERSION); "ModSecurity: LUA compiled version=\"%s\"", LUA_VERSION);
#endif /* WITH_LUA */ #endif /* WITH_LUA */
#ifdef WITH_YAJL #ifdef WITH_YAJL
 End of changes. 9 change blocks. 
9 lines changed or deleted 20 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)