summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2021-04-09 13:05:07 +0200
committerThomas Haller <thaller@redhat.com>2021-04-12 16:46:01 +0200
commitab3546b8e1c46ca919d5d7303a117d52ccd4d980 (patch)
treefedef3432b718397c2c54674ce63fb566d7a299c
parent1353a0e8da2db98eac571560654ef360e9e830d8 (diff)
downloadNetworkManager-ab3546b8e1c46ca919d5d7303a117d52ccd4d980.tar.gz
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.
-rw-r--r--src/core/nm-audit-manager.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/core/nm-audit-manager.c b/src/core/nm-audit-manager.c
index a1d20fcb62..2352aa84e0 100644
--- a/src/core/nm-audit-manager.c
+++ b/src/core/nm-audit-manager.c
@@ -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);
}
}