Fix journald audit logging with fields > N_IOVEC_AUDIT_FIELDS.

ELEMENTSOF(iovec) is not the correct value for the newly introduced parameter m
to function map_all_fields because it is the maximum number of elements in the
iovec array, including those reserved for N_IOVEC_META_FIELDS. The correct
value is the current number of already used elements in the array plus the
maximum number to use for fields decoded from the kernel audit message.
This commit is contained in:
YmrDtnJu
2022-01-21 23:12:45 +00:00
committed by Luca Boccassi
parent 76fb85316e
commit df4ec48f45
+1 -1
View File
@@ -399,7 +399,7 @@ void process_audit_string(Server *s, int type, const char *data, size_t size) {
z = n;
map_all_fields(p, map_fields_kernel, "_AUDIT_FIELD_", true, iovec, &n, ELEMENTSOF(iovec));
map_all_fields(p, map_fields_kernel, "_AUDIT_FIELD_", true, iovec, &n, n + N_IOVEC_AUDIT_FIELDS);
server_dispatch_message(s, iovec, n, ELEMENTSOF(iovec), NULL, NULL, LOG_NOTICE, 0);