baab13
From 80087d0d88e2ff5a3c644f939bbe602a064096c4 Mon Sep 17 00:00:00 2001
baab13
From: Julius Milan <jmilan@redhat.com>
baab13
Date: Tue, 26 Sep 2017 15:56:42 +0200
baab13
Subject: [PATCH] koops: Improve not-reportable for oopses with taint flags
baab13
baab13
Adds detailed info about taint flags to not-reportable. This
baab13
additional info contains description of every taint flag that appeared
baab13
in particular oops.
baab13
It is either good for user information and also solves the problem when users
baab13
opened bugs on abrt from misunderstanding tainted flags.
baab13
baab13
Related to rhbz#1452160
baab13
---
baab13
 src/lib/kernel.c             | 7 ++++---
baab13
 src/plugins/abrt-dump-oops.c | 8 ++++----
baab13
 2 files changed, 8 insertions(+), 7 deletions(-)
baab13
baab13
diff --git a/src/lib/kernel.c b/src/lib/kernel.c
baab13
index 3c8cbdf..346b0a6 100644
baab13
--- a/src/lib/kernel.c
baab13
+++ b/src/lib/kernel.c
baab13
@@ -695,9 +695,10 @@ static const char *const tnts_long[] = {
baab13
     /* B */ "System has hit bad_page.",
baab13
     /* C */ "Modules from drivers/staging are loaded.",
baab13
     /* D */ "Kernel has oopsed before",
baab13
-    /* E */ NULL,
baab13
+    /* E */ "Unsigned module has been loaded.",
baab13
     /* F */ "Module has been forcibly loaded.",
baab13
-    /* G */ "Proprietary module has not been loaded.",
baab13
+            /* We don't want to be more descriptive about G flag */
baab13
+    /* G */ NULL, /* "Proprietary module has not been loaded." */
baab13
     /* H */ NULL,
baab13
     /* I */ "Working around severe firmware bug.",
baab13
     /* J */ NULL,
baab13
@@ -729,7 +730,7 @@ char *kernel_tainted_long(const char *tainted_short)
baab13
         {
baab13
             const char *const txt = tnts_long[tnt_index];
baab13
             if (txt)
baab13
-                strbuf_append_strf(tnt_long, "%s\n", txt);
baab13
+                strbuf_append_strf(tnt_long, "%c - %s\n", tainted_short[0], txt);
baab13
         }
baab13
 
baab13
         ++tainted_short;
baab13
diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c
baab13
index 05cb728..e7db19a 100644
baab13
--- a/src/plugins/abrt-dump-oops.c
baab13
+++ b/src/plugins/abrt-dump-oops.c
baab13
@@ -139,13 +139,12 @@ static void save_oops_data_in_dump_dir(struct dump_dir *dd, char *oops, const ch
baab13
 
baab13
             char *tnt_long = kernel_tainted_long(tainted_short);
baab13
             dd_save_text(dd, FILENAME_TAINTED_LONG, tnt_long);
baab13
-            free(tnt_long);
baab13
 
baab13
             struct strbuf *reason = strbuf_new();
baab13
             const char *fmt = _("A kernel problem occurred, but your kernel has been "
baab13
-                    "tainted (flags:%s). Kernel maintainers are unable to "
baab13
-                    "diagnose tainted reports.");
baab13
-            strbuf_append_strf(reason, fmt, tainted_short);
baab13
+                    "tainted (flags:%s). Explanation:\n%s"
baab13
+                    "Kernel maintainers are unable to diagnose tainted reports.");
baab13
+            strbuf_append_strf(reason, fmt, tainted_short, tnt_long);
baab13
 
baab13
             char *modlist = !proc_modules ? NULL : list_of_tainted_modules(proc_modules);
baab13
             if (modlist)
baab13
@@ -157,6 +156,7 @@ static void save_oops_data_in_dump_dir(struct dump_dir *dd, char *oops, const ch
baab13
             dd_save_text(dd, FILENAME_NOT_REPORTABLE, reason->buf);
baab13
             strbuf_free(reason);
baab13
             free(tainted_short);
baab13
+            free(tnt_long);
baab13
         }
baab13
     }
baab13
 
baab13
-- 
baab13
1.8.3.1
baab13