mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-08-16 07:56:12 +03:00
Fix AuditLog parts selection
This commit is contained in:
parent
9343942398
commit
b9b3e82900
@ -35,7 +35,7 @@ std::string Writer::file_name(const std::string& unique_id) {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
bool Writer::write(Transaction *transaction, int parts) {
|
bool Writer::write(Transaction *transaction, int parts) {
|
||||||
std::cout << transaction->toJSON(0) << std::endl;
|
std::cout << transaction->toJSON(parts) << std::endl;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1193,6 +1193,7 @@ int Transaction::processLogging(int returned_code) {
|
|||||||
#endif
|
#endif
|
||||||
std::list<std::pair<int, std::string>>::iterator it;
|
std::list<std::pair<int, std::string>>::iterator it;
|
||||||
parts = this->m_rules->audit_log->m_parts;
|
parts = this->m_rules->audit_log->m_parts;
|
||||||
|
debug(7, "AuditLog parts before modification(s): " + std::to_string(parts) + ".");
|
||||||
for (it = m_auditLogModifier.begin();
|
for (it = m_auditLogModifier.begin();
|
||||||
it != m_auditLogModifier.end(); ++it) {
|
it != m_auditLogModifier.end(); ++it) {
|
||||||
std::pair <int, std::string> p = *it;
|
std::pair <int, std::string> p = *it;
|
||||||
@ -1215,7 +1216,7 @@ int Transaction::processLogging(int returned_code) {
|
|||||||
bool saved = this->m_rules->audit_log->saveIfRelevant(this, parts);
|
bool saved = this->m_rules->audit_log->saveIfRelevant(this, parts);
|
||||||
if (saved) {
|
if (saved) {
|
||||||
#ifndef NO_LOGS
|
#ifndef NO_LOGS
|
||||||
debug(8, "Request was relevant to be saved.");
|
debug(8, "Request was relevant to be saved. Parts: " + std::to_string(parts));
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1401,7 +1402,6 @@ std::string Transaction::toJSON(int parts) {
|
|||||||
std::string ts = ascTime(&m_timeStamp).c_str();
|
std::string ts = ascTime(&m_timeStamp).c_str();
|
||||||
std::string uniqueId = UniqueId::uniqueId();
|
std::string uniqueId = UniqueId::uniqueId();
|
||||||
|
|
||||||
parts = 0;
|
|
||||||
g = yajl_gen_alloc(NULL);
|
g = yajl_gen_alloc(NULL);
|
||||||
if (g == NULL) {
|
if (g == NULL) {
|
||||||
return "";
|
return "";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user