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