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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user