fa19501
From 31e54ec8ea43d246e745a3a58fc5f07bfce4dfa0 Mon Sep 17 00:00:00 2001
fa19501
From: Jakub Filak <jfilak@redhat.com>
fa19501
Date: Mon, 18 May 2015 08:43:29 +0200
fa19501
Subject: [PATCH] koops: don't save dmesg if kernel.dmesg_restrict=1
fa19501
fa19501
Also don't run abrt-action-check-oops-for-hw-error if the file dmesg
fa19501
does not exist as the program searches MCE related strings there.
fa19501
fa19501
Related: rhbz#1128400
fa19501
Requires: rhbz#1227661
fa19501
fa19501
Signed-off-by: Jakub Filak <jfilak@redhat.com>
fa19501
---
fa19501
 src/plugins/koops_event.conf | 15 +++++++--------
fa19501
 1 file changed, 7 insertions(+), 8 deletions(-)
fa19501
fa19501
diff --git a/src/plugins/koops_event.conf b/src/plugins/koops_event.conf
fa19501
index eea1055..0e413a8 100644
fa19501
--- a/src/plugins/koops_event.conf
fa19501
+++ b/src/plugins/koops_event.conf
fa19501
@@ -1,13 +1,12 @@
fa19501
 # Analyze
fa19501
 EVENT=post-create analyzer=Kerneloops
fa19501
-        # >> instead of > is due to bugzilla.redhat.com/show_bug.cgi?id=854266
fa19501
-        # 'dmesg' file is required by check-oops-for-hw-error
fa19501
-        dmesg >>dmesg
fa19501
-        # Do not fail the event (->do not delete problem dir)
fa19501
-        # if check-oops-for-hw-error exits nonzero:
fa19501
-        {
fa19501
-        abrt-action-check-oops-for-hw-error || true
fa19501
-        } &&
fa19501
+        # Honor dmesg_restrict -> bugzilla.redhat.com/1128400
fa19501
+        if [ "$(cat /proc/sys/kernel/dmesg_restrict)" == "0" ]; then
fa19501
+            # >> instead of > is due to bugzilla.redhat.com/854266
fa19501
+            # 'dmesg' file is required by check-oops-for-hw-error
fa19501
+            dmesg >>dmesg
fa19501
+            abrt-action-check-oops-for-hw-error
fa19501
+        fi
fa19501
         {
fa19501
         # run abrt-action-analyze-oops only if check-hw-error didn't create the
fa19501
         # required files
fa19501
-- 
fa19501
2.1.0
fa19501