Skip to content

Commit 04ea802

Browse files
committed
Fix enriched formatting by adding expected newline
1 parent 707220f commit 04ea802

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/auditd-event.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,17 @@ static const char *format_enrich(const struct audit_reply *rep)
448448
if (len <= MIN_SPACE_LEFT)
449449
return format_buf;
450450

451+
// Add carriage return so auparse sees it correctly
452+
format_buf[mlen] = 0x0A;
453+
format_buf[mlen+1] = 0;
454+
451455
// init auparse
452456
if (au == NULL) {
453457
au = auparse_init(AUSOURCE_BUFFER, format_buf);
454-
if (au == NULL)
458+
if (au == NULL) {
459+
format_buf[mlen] = 0; //remove newline
455460
return format_buf;
461+
}
456462

457463
auparse_set_escape_mode(au, AUPARSE_ESC_RAW);
458464
auparse_set_eoe_timeout(config->end_of_event_timeout);

0 commit comments

Comments
 (0)