mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-15 23:55:03 +03:00
Explicitly set log object to r->connection->log in preaccess phase handler.
This change fixes a number of scenarios when ModSecurity's log entries may be written to the wrong file descriptors. In particular, there was an issue with almost any configuration using nginx cache features (proxy_cache, fastcgi_cache, etc) when garbage from ModSecurity logs has been sent to the control socket used for communication between nginx master process and auxiliary processes (workers, cache manager, cache loader). Described behavior was observed with nginx/1.7.0, modsecurity/2.8.0 and OWASP CRS v2.2.9.
This commit is contained in:
parent
5d9f0d85b2
commit
d0ead529d9
@ -1125,6 +1125,8 @@ ngx_http_modsecurity_handler(ngx_http_request_t *r) {
|
||||
ngx_http_modsecurity_ctx_t *ctx = NULL;
|
||||
ngx_http_modsecurity_loc_conf_t *cf = NULL;
|
||||
|
||||
modsecSetLogHook(r->connection->log, modsecLog);
|
||||
|
||||
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
|
||||
"ModSec: Catching a new access phase handler. Count: %d",
|
||||
r->main->count);
|
||||
|
Loading…
x
Reference in New Issue
Block a user