{dis|en}able-collection-delete-problem-logging: Option to disable logging of collection delete problem in audit log when log level < 9 in audit log [Issue #576 - Marc Stern]

This commit is contained in:
Marc Stern 2017-04-26 14:04:45 -03:00 committed by Felipe Zimmerle
parent 53a8bb2e18
commit d243818aff
No known key found for this signature in database
GPG Key ID: E6DFB08CE8B11277
3 changed files with 29 additions and 5 deletions

View File

@ -1,6 +1,9 @@
DD MMM YYYY - 2.9.2 - To be released
------------------------------------
* {dis|en}able-collection-delete-problem-logging: Option to disable logging of
collection delete problem in audit log when log level < 9.
[Issue #576 - Marc Stern]
* Adds rule id in logs whenever a rule fail.
[Issue #1379, #391 - Marc Stern]
* {dis|en}able-server-logging: Option to disable logging of

View File

@ -217,10 +217,13 @@ static apr_table_t *collection_retrieve_ex(apr_sdbm_t *existing_dbm, modsec_rec
rc = apr_sdbm_delete(dbm, key);
if (rc != APR_SUCCESS) {
msr_log(msr, 1, "collection_retrieve_ex: Failed deleting collection (name \"%s\", "
#ifdef LOG_NO_COLL_DELET_PB
if (msr->txcfg->debuglog_level >= 9)
#endif
msr_log(msr, 1, "collection_retrieve_ex: Failed deleting collection (name \"%s\", "
"key \"%s\"): %s", log_escape(msr->mp, col_name),
log_escape_ex(msr->mp, col_key, col_key_len), get_apr_error(msr->mp, rc));
msr->msc_sdbm_delete_error = 1;
msr->msc_sdbm_delete_error = 1;
goto cleanup;
}
@ -678,10 +681,13 @@ int collections_remove_stale(modsec_rec *msr, const char *col_name) {
if (expiry_time <= now) {
rc = apr_sdbm_delete(dbm, key);
if (rc != APR_SUCCESS) {
msr_log(msr, 1, "collections_remove_stale: Failed deleting collection (name \"%s\", "
#ifdef LOG_NO_COLL_DELET_PB
if (msr->txcfg->debuglog_level >= 9)
#endif
msr_log(msr, 1, "collections_remove_stale: Failed deleting collection (name \"%s\", "
"key \"%s\"): %s", log_escape(msr->mp, col_name),
log_escape_ex(msr->mp, key.dptr, key.dsize - 1), get_apr_error(msr->mp, rc));
msr->msc_sdbm_delete_error = 1;
msr->msc_sdbm_delete_error = 1;
goto error;
}

View File

@ -457,6 +457,21 @@ AC_ARG_ENABLE(server-logging,
log_server=''
])
# Disable logging of problem when deleting collection
AC_ARG_ENABLE(collection-delete-problem-logging,
AS_HELP_STRING([--enable-collection-delete-problem-logging],
[Enable logging of collection delete problem in audit log when log level < 9. This is the default]),
[
if test "$enableval" != "no"; then
log_collection_delete_problem=
else
log_collection_delete_problem="-DLOG_NO_COLL_DELET_PB"
fi
],
[
log_collection_delete_problem=''
])
# Ignore configure errors
AC_ARG_ENABLE(errors,
AS_HELP_STRING([--disable-errors],
@ -707,7 +722,7 @@ else
fi
fi
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $htaccess_config $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type $unique_id $log_filename $log_server"
MODSEC_EXTRA_CFLAGS="$pcre_study $pcre_match_limit $pcre_match_limit_recursion $pcre_jit $request_early $htaccess_config $lua_cache $debug_conf $debug_cache $debug_acmp $debug_mem $perf_meas $modsec_api $cpu_type $unique_id $log_filename $log_server $log_collection_delete_problem"
APXS_WRAPPER=build/apxs-wrapper
APXS_EXTRA_CFLAGS=""