Removed SecDefineRemoteAddr and fixed Apache 2.4 mod_remoteip integration

This commit is contained in:
Breno Silva
2013-05-06 00:49:07 -04:00
parent 06fc5e56c0
commit cd31b39ce1
4 changed files with 9 additions and 75 deletions

View File

@@ -272,24 +272,9 @@ static void internal_log_ex(request_rec *r, directory_config *dcfg, modsec_rec *
"[client %s] ModSecurity: %s%s [uri \"%s\"]%s", r->useragent_ip ? r->useragent_ip : r->connection->client_ip, str1,
hostname, log_escape(msr->mp, r->uri), unique_id);
#else
if(strcasecmp(msr->txcfg->remote_define, "default") == 0) {
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r->server,
"[client %s] ModSecurity: %s%s [uri \"%s\"]%s", r->connection->remote_ip, str1,
hostname, log_escape(msr->mp, r->uri), unique_id);
} else {
remote = (char *)apr_table_get(msr->r->headers_in, msr->txcfg->remote_define);
if(remote == NULL) {
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r->server,
"[client %s] ModSecurity: %s%s [uri \"%s\"]%s", r->connection->remote_ip, str1,
hostname, log_escape(msr->mp, r->uri), unique_id);
} else {
parse_remote = apr_pstrdup(msr->mp, remote);
str = apr_strtok(parse_remote, ",", &saved);
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r->server,
"[client %s] ModSecurity: %s%s [uri \"%s\"]%s", str, str1,
hostname, log_escape(msr->mp, r->uri), unique_id);
}
}
ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_NOERRNO, 0, r->server,
"[client %s] ModSecurity: %s%s [uri \"%s\"]%s", msr->remote_addr ? msr->remote_addr : r->connection->remote_ip, str1,
hostname, log_escape(msr->mp, r->uri), unique_id);
#endif
/* Add this message to the list. */