audit: fix using original file:line information for audit logging

With structured logging (journald), the file, line and func information
is relevant. Propagate the right value to the audit logging line.
This commit is contained in:
Thomas Haller 2021-04-09 13:05:07 +02:00
parent 1353a0e8da
commit ab3546b8e1
No known key found for this signature in database
GPG key ID: 29C2366E4DFC5728

View file

@ -174,7 +174,18 @@ nm_audit_log(NMAuditManager *self,
if (nm_logging_enabled(AUDIT_LOG_LEVEL, LOGD_AUDIT)) {
msg = build_message(fields, BACKEND_LOG);
_NMLOG(AUDIT_LOG_LEVEL, LOGD_AUDIT, "%s", msg);
_nm_log_full(file,
line,
func,
!(NM_THREAD_SAFE_ON_MAIN_THREAD),
AUDIT_LOG_LEVEL,
LOGD_AUDIT,
0,
NULL,
NULL,
"%s%s",
_NMLOG_PREFIX_NAME ": ",
msg);
g_free(msg);
}
}