1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-02 19:21:53 +03:00

journald: suppress low-level audit text prefix in MESSAGE= field

Let's make the log output more readable, and the header can be
reconstructed in full from the other fields
This commit is contained in:
Lennart Poettering 2014-11-04 00:27:55 +01:00
parent 78fe420ff0
commit 5034c7bcdf

View File

@ -354,7 +354,7 @@ static void process_audit_string(Server *s, int type, const char *data, size_t s
if (!p)
return;
if (sscanf(p, "(%" PRIi64 ".%" PRIi64 ":%" PRIi64 "): %n",
if (sscanf(p, "(%" PRIi64 ".%" PRIi64 ":%" PRIi64 "):%n",
&seconds,
&msec,
&id,
@ -362,6 +362,10 @@ static void process_audit_string(Server *s, int type, const char *data, size_t s
return;
p += k;
p += strspn(p, WHITESPACE);
if (isempty(p))
return;
n_iov_allocated = N_IOVEC_META_FIELDS + 5;
iov = new(struct iovec, n_iov_allocated);
@ -382,7 +386,7 @@ 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=", data);
m = strappenda("MESSAGE=audit: ", p);
IOVEC_SET_STRING(iov[n_iov++], m);
z = n_iov;