diff options
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/abrt-action-bugzilla.c | 84 | ||||
-rw-r--r-- | src/plugins/abrt-action-bugzilla.txt | 77 | ||||
-rw-r--r-- | src/plugins/abrt-action-install-debuginfo | 35 | ||||
-rw-r--r-- | src/plugins/abrt-action-rhtsupport.c | 2 | ||||
-rw-r--r-- | src/plugins/abrt-dump-oops.c | 14 | ||||
-rw-r--r-- | src/plugins/rhbz.c | 19 |
6 files changed, 85 insertions, 146 deletions
diff --git a/src/plugins/abrt-action-bugzilla.c b/src/plugins/abrt-action-bugzilla.c index ee678fe8..5483e420 100644 --- a/src/plugins/abrt-action-bugzilla.c +++ b/src/plugins/abrt-action-bugzilla.c @@ -24,69 +24,6 @@ #define XML_RPC_SUFFIX "/xmlrpc.cgi" -/* From RHEL6 kernel/panic.c: - * { TAINT_PROPRIETARY_MODULE, 'P', 'G' }, - * { TAINT_FORCED_MODULE, 'F', ' ' }, - * { TAINT_UNSAFE_SMP, 'S', ' ' }, - * { TAINT_FORCED_RMMOD, 'R', ' ' }, - * { TAINT_MACHINE_CHECK, 'M', ' ' }, - * { TAINT_BAD_PAGE, 'B', ' ' }, - * { TAINT_USER, 'U', ' ' }, - * { TAINT_DIE, 'D', ' ' }, - * { TAINT_OVERRIDDEN_ACPI_TABLE, 'A', ' ' }, - * { TAINT_WARN, 'W', ' ' }, - * { TAINT_CRAP, 'C', ' ' }, - * { TAINT_FIRMWARE_WORKAROUND, 'I', ' ' }, - * entries 12 - 27 are unused - * { TAINT_HARDWARE_UNSUPPORTED, 'H', ' ' }, - * entries 29 - 31 are unused - */ - -static const char * const taint_warnings[] = { - "Proprietary Module", - "Forced Module", - "Unsafe SMP", - "Forced rmmod", - "Machine Check", - "Bad Page", - "User", - "Die", - "Overriden ACPI Table", - "Warning Issued", - "Experimental Module Loaded", - "Firmware Workaround", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - "Hardware Unsupported", - NULL, - NULL, -}; - -/* TODO: npajkovs: fix tainted string */ -static const char *tainted_string(unsigned tainted) -{ - unsigned idx = 0; - while ((tainted >>= 1) != 0) - idx++; - - return taint_warnings[idx]; -} - static void report_to_bugzilla(const char *dump_dir_name, map_string_h *settings) { struct dump_dir *dd = dd_opendir(dump_dir_name, /*flags:*/ 0); @@ -298,7 +235,26 @@ int main(int argc, char **argv) const char *program_usage_string = _( "\b [-v] -c CONFFILE -d DIR\n" "\n" - "Reports problem to Bugzilla" + "Reports problem to Bugzilla.\n" + "\n" + "The tool reads DIR. Then it logs in to Bugzilla and tries to find a bug\n" + "with the same abrt_hash:HEXSTRING in 'Whiteboard'.\n" + "\n" + "If such bug is not found, then a new bug is created. Elements of DIR\n" + "are stored in the bug as part of bug description or as attachments,\n" + "depending on their type and size.\n" + "\n" + "Otherwise, if such bug is found and it is marked as CLOSED DUPLICATE,\n" + "the tool follows the chain of duplicates until it finds a non-DUPLICATE bug.\n" + "The tool adds a new comment to found bug.\n" + "\n" + "The URL to new or modified bug is printed to stdout and recorded in\n" + "'reported_to' element.\n" + "\n" + "CONFFILE lines should have 'PARAM = VALUE' format.\n" + "Recognized string parameters: BugzillaURL, Login, Password.\n" + "Recognized boolean parameter (VALUE should be 1/0, yes/no): SSLVerify.\n" + "Parameters can be overridden via $Bugzilla_PARAM environment variables." ); enum { OPT_v = 1 << 0, diff --git a/src/plugins/abrt-action-bugzilla.txt b/src/plugins/abrt-action-bugzilla.txt index 313e5b19..6002ccf2 100644 --- a/src/plugins/abrt-action-bugzilla.txt +++ b/src/plugins/abrt-action-bugzilla.txt @@ -3,7 +3,7 @@ abrt-action-buzilla(1) NAME ---- -abrt-action-bugzilla - Sends problem information to bugzilla. +abrt-action-bugzilla - Reports problem to Bugzilla. SYNOPSIS -------- @@ -11,27 +11,23 @@ SYNOPSIS DESCRIPTION ----------- -The tool reads a problem dump direcotry. Firstly, the tool is trying to find -duplication of bug. If duplication is 'not' found, then a new bug is created. -Otherwise if duplication 'is' found and bug is closed as duplication of the -other bug, than, so called, 'hoping' begin. It means, that tool is going to try -track the origin bug. +The tool reads problem dump directory DIR. Then it logs in to Bugzilla +and tries to find a bug with the same abrt_hash:HEXSTRING in 'Whiteboard'. -Example of bug stages are: ------------- -CLOSED DUPLICATE -> CLOSED DUPLICATE -> NEW ------------- -Third one is the origin of the same problem. The tool adds a new comment to bug, -logouts from bugzilla and return link to bug. +If such bug is not found, then a new bug is created. Elements of DIR +are stored in the bug as part of bug description or as attachments, +depending on their type and size. + +Otherwise, if such bug is found and it is marked as CLOSED DUPLICATE, +the tool follows the chain of duplicates until it finds a non-DUPLICATE bug. +The tool adds a new comment to found bug. -Properties of bugzilla can be specified in a configuration file, -and via environment variables. +The URL to new or modified bug is printed to stdout and recorded in +'reported_to' element in DIR. Configuration file ~~~~~~~~~~~~~~~~~~ -Configuration file contains entries in a format "Option = Value". - -The options are: +Configuration file lines should have 'PARAM = VALUE' format. The parameters are: 'Login':: Login to Bugzilla account. @@ -40,28 +36,22 @@ The options are: Password to Bugzilla account. 'BugzillaURL':: - Bugzilla http address. (default: https://bugzilla.redht.com) + Bugzilla http(s) address. (default: https://bugzilla.redht.com) 'SSLVerify':: Use yes/true/on/1 to verify Bugzilla ssl certificate. (default: yes) +Parameters can be overridden via $Bugzilla_PARAM environment variables. + Integration with ABRT events ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -'abrt-action-bugzilla' can be used as a reporter, to allow users report -problems to bugzilla when they decide to do it. This usage is -pre-configured in /etc/abrt/events.d/ccpp_events.conf and -/etc/abrt/abrt_events.conf. +'abrt-action-bugzilla' can be used as an ABRT reporter. Example +fragment for /etc/abrt/abrt_events.conf: -For python problems (/etc/abrt/abrt_events.conf) ------------ +# Report Python crashes EVENT=report_Bugzilla analyzer=Python - abrt-action-bugzilla -c /etc/abrt/plugins/Bugzilla.conf ------------- - -For C/C++ problems (/etc/abrt/events.d/ccpp_events.conf) ------------- -EVENT=report_Bugzilla analyzer=CCpp - abrt-action-bugzilla -c /etc/abrt/plugins/Bugzilla.conf + abrt-action-bugzilla -d . -c /etc/abrt/plugins/Bugzilla.conf ------------ OPTIONS @@ -70,27 +60,8 @@ OPTIONS Path to dump directory. -c CONFFILE:: - Path to configration file. When used in ABRT event system, the file - contains site-wide configuration. Users can change the values via - environment variables. - -ENVIRONMENT VARIABLES ---------------------- -Environment variables take precedence over values provided in -the configuration file. + Path to configration file. -'Bugzilla_Login':: - Login to Bugzilla account. - -'Bugzilla_Password':: - Password to Bugzilla account. - -'Bugzilla_BugzillaURL':: - Bugzilla http address. (default: https://bugzilla.redht.com) - -'Bugzilla_SSLVerify':: - Use yes/true/on/1 to verify Bugzilla ssl certificate. (default: yes) - -AUTHORS -------- -* ABRT team +SEE ALSO +-------- +abrt_event.conf diff --git a/src/plugins/abrt-action-install-debuginfo b/src/plugins/abrt-action-install-debuginfo index 75079ff9..2ad0790a 100644 --- a/src/plugins/abrt-action-install-debuginfo +++ b/src/plugins/abrt-action-install-debuginfo @@ -93,9 +93,8 @@ def ask_yes_no(prompt, retries=4): # TODO: unpack just required debuginfo and not entire rpm? # ..that can lead to: foo.c No such file and directory # files is not used... -def unpack_rpm(package_nevra, files, tmp_dir, destdir, keeprpm): - package_name = package_nevra + ".rpm" - package_full_path = tmp_dir + "/" + package_name +def unpack_rpm(package_file_name, files, tmp_dir, destdir, keeprpm): + package_full_path = tmp_dir + "/" + package_file_name log1("Extracting %s to %s", package_full_path, destdir) log2("%s", files) print _("Extracting cpio from %s") % (package_full_path) @@ -125,7 +124,7 @@ def unpack_rpm(package_nevra, files, tmp_dir, destdir, keeprpm): # and open it for reading unpacked_cpio = open(unpacked_cpio_path, 'rb') - print _("Caching files from %s made from %s") % ("unpacked.cpio", package_name) + print _("Caching files from %s made from %s") % ("unpacked.cpio", package_file_name) cpio = Popen(["cpio", "-idu", "--quiet"], stdin=unpacked_cpio, cwd=destdir, bufsize=-1) retcode = cpio.wait() @@ -309,17 +308,21 @@ class DebugInfoDownload(YumBase): os.makedirs(self.cachedir) local = os.path.join(self.tmpdir, local) pkg.localpath = local # Hack: to set the localpath we want - ret = self.downloadPkgs(pkglist=[pkg]) - # downloadPkgs return an non empty list on succes - if ret: + err = self.downloadPkgs(pkglist=[pkg]) + # normalize the name + # just str(pkg) doesn't work because it can have epoch + pkg_nvra = pkg.name + "-" + pkg.version + "-" + pkg.release + "." + pkg.arch + package_file_name = pkg_nvra + ".rpm" + if err: + # I observed a zero-length file left on error, + # which prevents cleanup later. Fix it: + try: + os.unlink(self.tmpdir + "/" + package_file_name) + except: + pass print (_("Downloading package %s failed") % pkg) else: - # normalize the name - # just str(pkg) doesn't work because it can have epoch - pkg_nvra = (pkg.name + "-" + pkg.version + "-" + - pkg.release + "." + pkg.arch) - - unpack_result = unpack_rpm(pkg_nvra, files, self.tmpdir, + unpack_result = unpack_rpm(package_file_name, files, self.tmpdir, self.cachedir, keeprpms) if unpack_result == RETURN_FAILURE: # recursively delete the temp dir on failure @@ -330,8 +333,10 @@ class DebugInfoDownload(YumBase): downloaded_pkgs += 1 if not self.keeprpms and os.path.exists(self.tmpdir): - print (_("All downloaded packages have been extracted, removing %s") - % self.tmpdir) + # Was: "All downloaded packages have been extracted, removing..." + # but it was appearing even if no packages were in fact extracted + # (say, when there was one package, and it has download error). + print (_("Removing %s") % self.tmpdir) try: os.rmdir(self.tmpdir) except OSError: diff --git a/src/plugins/abrt-action-rhtsupport.c b/src/plugins/abrt-action-rhtsupport.c index 89f9944c..989fd75d 100644 --- a/src/plugins/abrt-action-rhtsupport.c +++ b/src/plugins/abrt-action-rhtsupport.c @@ -305,7 +305,7 @@ int main(int argc, char **argv) "CONFFILE lines should have 'PARAM = VALUE' format.\n" "Recognized string parameters: URL, Login, Password.\n" "Recognized boolean parameter (VALUE should be 1/0, yes/no): SSLVerify.\n" - "Parameters can be overridded via $RHTSupport_PARAM environment variables." + "Parameters can be overridden via $RHTSupport_PARAM environment variables." ); enum { OPT_v = 1 << 0, diff --git a/src/plugins/abrt-dump-oops.c b/src/plugins/abrt-dump-oops.c index c2879caa..5eba8036 100644 --- a/src/plugins/abrt-dump-oops.c +++ b/src/plugins/abrt-dump-oops.c @@ -542,7 +542,21 @@ static unsigned save_oops_to_dump_dir(GList *oops_list, unsigned oops_cnt) dd_save_text(dd, FILENAME_REASON, second_line); if (tainted_str && tainted_str[0] != '0') + { + unsigned long tainted = xatoi_positive(tainted_str); + char *tainted_short = kernel_tainted_short(tainted); + GList *tainted_long = kernel_tainted_long(tainted); + + struct strbuf *tnt_long = strbuf_new(); + for (GList *li = tainted_long; li; li = li->next) + strbuf_append_strf(tnt_long, "%s\n", (char*) li->data); + dd_save_text(dd, FILENAME_TAINTED, tainted_str); + dd_save_text(dd, FILENAME_TAINTED_SHORT, tainted_short); + dd_save_text(dd, FILENAME_TAINTED_LONG, tnt_long->buf); + strbuf_free(tnt_long); + list_free_with_free(tainted_long); + } dd_close(dd); } diff --git a/src/plugins/rhbz.c b/src/plugins/rhbz.c index 83c3d20a..86cd86d7 100644 --- a/src/plugins/rhbz.c +++ b/src/plugins/rhbz.c @@ -300,8 +300,8 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, FILENAME_CRASH_FUNCTION); const char *analyzer = get_problem_item_content_or_NULL(problem_data, FILENAME_ANALYZER); - const char *tainted_str = get_problem_item_content_or_NULL(problem_data, - FILENAME_TAINTED); + const char *tainted_short = get_problem_item_content_or_NULL(problem_data, + FILENAME_TAINTED_SHORT); struct strbuf *buf_summary = strbuf_new(); strbuf_append_strf(buf_summary, "[abrt] %s", package); @@ -312,17 +312,10 @@ int rhbz_new_bug(struct abrt_xmlrpc *ax, problem_data_t *problem_data, if (reason != NULL) strbuf_append_strf(buf_summary, ": %s", reason); - if (tainted_str && analyzer - && (strcmp(analyzer, "Kerneloops") == 0) - ) { - //TODO: fix me; basically it doesn't work as it suppose to work - // I will fix it immediately when this patch land into abrt git - /* - unsigned long tainted = xatoi_positive(tainted_str); - const char *tainted_warning = tainted_string(tainted); - if (tainted_warning) - strbuf_append_strf(buf_summary, ": TAINTED %s", tainted_warning); - */ + if (tainted_short && analyzer + && (strcmp(analyzer, "Kerneloops") == 0)) + { + strbuf_append_strf(buf_summary, ": TAINTED %s", tainted_short); } char *status_whiteboard = xasprintf("abrt_hash:%s", duphash); |