From fb38ce6c4222f38caf0e7862189b6df3928623c0 Mon Sep 17 00:00:00 2001 From: Petr Lautrbach Date: May 28 2020 19:47:34 +0000 Subject: framework: Log full reports with correct syslog identifier Fixes: $ journal ... setroubleshoot[21264]: SELinux is preventing runcon from using the transition access on a process. For complete SELinux messages run: sealert -l 2340b07c-5e35-4452-b5de-b118de800a62 python3[21264]: SELinux is preventing runcon from using the transition access on a process. ***** Plugin catchall (100. confidence) suggests ************************** ... --- diff --git a/framework/src/setroubleshoot/server.py b/framework/src/setroubleshoot/server.py index 167e586..c3a378a 100755 --- a/framework/src/setroubleshoot/server.py +++ b/framework/src/setroubleshoot/server.py @@ -158,6 +158,7 @@ host_database = None analysis_queue = None email_recipients = None email_recipients_filepath = get_config('email', 'recipients_filepath') +pkg_name = get_config('general', 'pkg_name') pkg_version = get_config('general', 'pkg_version') rpc_version = get_config('general', 'rpc_version') instance_id = make_instance_id() @@ -229,7 +230,8 @@ class AlertPluginReportReceiver(PluginReportReceiver): pid = audit_record.fields["pid"] break if get_config('setroubleshootd_log', 'log_full_report', bool): - systemd.journal.send(siginfo.format_text(), OBJECT_PID=pid) + global pkg_name + systemd.journal.send(siginfo.format_text(), OBJECT_PID=pid, SYSLOG_IDENTIFIER=pkg_name) for u in siginfo.users: action = siginfo.evaluate_filter_for_user(u.username) @@ -760,7 +762,7 @@ def RunFaultServer(timeout=10): # currently syslog is only used for putting an alert into # the syslog with it's id - pkg_name = get_config('general', 'pkg_name') + global pkg_name syslog.openlog(pkg_name) # Create an object responsible for sending notifications to clients