summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2010-11-15 16:40:47 +0100
committerNikola Pajkovsky <npajkovs@redhat.com>2010-11-15 16:40:47 +0100
commit746e0fc91c8e169f36e6e8678426d8aad23ca7d0 (patch)
tree3df512ba62d55c4ae2e019df6ee314335aa7f3f5
parentda564d0e3b98e0ad62af9877c32f6c5a1ef510c9 (diff)
downloadabrt-746e0fc91c8e169f36e6e8678426d8aad23ca7d0.tar.gz
abrt-746e0fc91c8e169f36e6e8678426d8aad23ca7d0.tar.xz
abrt-746e0fc91c8e169f36e6e8678426d8aad23ca7d0.zip
rhbz 623142
Save tainted flag from /proc/sys/kernel/tainted. When flag is set to 1 TAINED string is added to bugzilla summary. Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
-rw-r--r--inc/crash_types.h1
-rw-r--r--lib/Plugins/Bugzilla.cpp11
-rw-r--r--lib/Plugins/KerneloopsScanner.cpp15
3 files changed, 27 insertions, 0 deletions
diff --git a/inc/crash_types.h b/inc/crash_types.h
index 25dbcd46..5eba6480 100644
--- a/inc/crash_types.h
+++ b/inc/crash_types.h
@@ -49,6 +49,7 @@
#define FILENAME_REPRODUCE "reproduce"
#define FILENAME_RATING "rating"
#define FILENAME_HOSTNAME "hostname"
+#define FILENAME_TAINTED "tainted"
// Optional. Set to "1" by abrt-handle-upload for every unpacked crashdump
#define FILENAME_REMOTE "remote"
// TODO: TicketUploader also has open-coded "TICKET", "CUSTOMER" files
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index f3967cdf..e4255d2e 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -396,6 +396,8 @@ xmlrpc_int32 ctx::new_bug(const map_crash_data_t& pCrashData, int depend_on_bugn
const std::string& duphash = get_crash_data_item_content(pCrashData, CD_DUPHASH);
const char *reason = get_crash_data_item_content_or_NULL(pCrashData, FILENAME_REASON);
const char *function = get_crash_data_item_content_or_NULL(pCrashData, FILENAME_CRASH_FUNCTION);
+ const char *analyzer = get_crash_data_item_content_or_NULL(pCrashData, FILENAME_ANALYZER);
+ const char *tainted = get_crash_data_item_content_or_NULL(pCrashData, FILENAME_TAINTED);
std::string summary = "[abrt] " + package;
if (function != NULL && strlen(function) < 30)
@@ -409,6 +411,15 @@ xmlrpc_int32 ctx::new_bug(const map_crash_data_t& pCrashData, int depend_on_bugn
summary += ": ";
summary += reason;
}
+
+ if (tainted && analyzer
+ && (tainted[0] == '1')
+ && (strcmp(analyzer, "Kerneloops") == 0)
+ ) {
+ summary += ": ";
+ summary += "TAINTED";
+ }
+
std::string status_whiteboard = "abrt_hash:" + duphash;
std::string description = "abrt version: "VERSION"\n";
diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp
index dc1f6d0a..8f2987be 100644
--- a/lib/Plugins/KerneloopsScanner.cpp
+++ b/lib/Plugins/KerneloopsScanner.cpp
@@ -122,6 +122,20 @@ void save_oops_to_debug_dump(const vector_string_t& oopsList)
VERB1 log("Saving %u oopses as crash dump dirs", idx >= countdown ? countdown-1 : idx);
+ char tainted[1] = {'-1'};
+ /* once tainted flag is set to 1, only restart can reset the flag to 0 */
+ int tainted_fd = open("/proc/sys/kernel/tainted", O_RDONLY);
+ if (tainted_fd > 0)
+ {
+ /* contain only 0 or 1 */
+ if (read(tainted_fd, &tainted, 1) != 1)
+ error_msg("Unable to read one byte from /proc/sys/kernel/tainted");
+
+ close(tainted_fd);
+ }
+ else
+ error_msg("/proc/sys/kernel/tainted does not exist");
+
while (idx != 0 && --countdown != 0)
{
char path[sizeof(DEBUG_DUMPS_DIR"/kerneloops-%lu-%lu-%lu") + 3 * sizeof(long)*3];
@@ -143,6 +157,7 @@ void save_oops_to_debug_dump(const vector_string_t& oopsList)
/* Optional, makes generated bz more informative */
strchrnul(second_line, '\n')[0] = '\0';
dd.SaveText(FILENAME_REASON, second_line);
+ dd.SaveText(FILENAME_TAINTED, tainted);
}
catch (CABRTException& e)
{