Blame SOURCES/0286-koops-Improve-not-reportable-for-oopses-with-taint-f.patch

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