summaryrefslogtreecommitdiff
path: root/src/journal/journald-audit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal/journald-audit.c')
-rw-r--r--src/journal/journald-audit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c
index 76f6f3fbde..f543732506 100644
--- a/src/journal/journald-audit.c
+++ b/src/journal/journald-audit.c
@@ -345,7 +345,7 @@ static void process_audit_string(Server *s, int type, const char *data, size_t s
char id_field[sizeof("_AUDIT_ID=") + DECIMAL_STR_MAX(uint64_t)],
type_field[sizeof("_AUDIT_TYPE=") + DECIMAL_STR_MAX(int)],
source_time_field[sizeof("_SOURCE_REALTIME_TIMESTAMP=") + DECIMAL_STR_MAX(usec_t)];
- const char *m;
+ char *m;
assert(s);
@@ -396,7 +396,8 @@ static void process_audit_string(Server *s, int type, const char *data, size_t s
sprintf(id_field, "_AUDIT_ID=%" PRIu64, id);
IOVEC_SET_STRING(iov[n_iov++], id_field);
- m = strappenda("MESSAGE=audit: ", p);
+ m = alloca(strlen("MESSAGE=audit-") + DECIMAL_STR_MAX(int) + strlen(": ") + strlen(p) + 1);
+ sprintf(m, "MESSAGE=audit-%i: %s", type, p);
IOVEC_SET_STRING(iov[n_iov++], m);
z = n_iov;