summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-11-04 01:00:50 +0100
committerLennart Poettering <lennart@poettering.net>2014-11-04 01:00:50 +0100
commit25b3245fb483e52766867dfe33ce271011caaca9 (patch)
treea474bbe81284942bcb0031c6fdb467f9139652f0 /src
parent9833a66c7eba011c3740867c80133bc6fa976aa3 (diff)
journald: include audit message type number in MESSAGE= string
Diffstat (limited to 'src')
-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;