diff options
-rw-r--r-- | abrt.spec | 2 | ||||
-rw-r--r-- | lib/Plugins/Bugzilla.conf | 1 | ||||
-rw-r--r-- | lib/Plugins/FileTransfer.conf | 3 | ||||
-rw-r--r-- | lib/Plugins/Makefile.am | 4 | ||||
-rw-r--r-- | lib/Plugins/RHTSupport.conf | 1 | ||||
-rw-r--r-- | lib/Plugins/RHTSupport.cpp | 18 | ||||
-rw-r--r-- | lib/Plugins/TicketUploader.conf | 3 | ||||
-rw-r--r-- | lib/Utils/abrt_rh_support.cpp | 22 | ||||
-rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 6 |
9 files changed, 41 insertions, 19 deletions
@@ -419,7 +419,7 @@ fi %files plugin-rhtsupport %defattr(-,root,root,-) -#%config(noreplace) %{_sysconfdir}/%{name}/plugins/RHTSupport.conf +%config(noreplace) %{_sysconfdir}/%{name}/plugins/RHTSupport.conf %{_libdir}/%{name}/libRHTSupport.so* %{_libdir}/%{name}/RHTSupport.GTKBuilder #%{_mandir}/man7/%{name}-RHTSupport.7.gz diff --git a/lib/Plugins/Bugzilla.conf b/lib/Plugins/Bugzilla.conf index ff2f8286..bd83a08e 100644 --- a/lib/Plugins/Bugzilla.conf +++ b/lib/Plugins/Bugzilla.conf @@ -1,4 +1,5 @@ Enabled = yes + # Bugzilla URL BugzillaURL = https://bugzilla.redhat.com/ # yes means that ssl certificates will not be checked diff --git a/lib/Plugins/FileTransfer.conf b/lib/Plugins/FileTransfer.conf index 30769b18..111c1c4b 100644 --- a/lib/Plugins/FileTransfer.conf +++ b/lib/Plugins/FileTransfer.conf @@ -1,6 +1,5 @@ -Enabled = yes - # Configuration of the FileTransfer reporter plugin. +Enabled = yes # The plugin is invoked in the abrt.conf file, usually in the # ActionsAndReporters option and/or the [cron] section. diff --git a/lib/Plugins/Makefile.am b/lib/Plugins/Makefile.am index d1d50218..bb370b71 100644 --- a/lib/Plugins/Makefile.am +++ b/lib/Plugins/Makefile.am @@ -35,6 +35,7 @@ dist_pluginsconf_DATA = \ Logger.conf \ Kerneloops.conf \ Bugzilla.conf \ + RHTSupport.conf \ Catcut.conf \ TicketUploader.conf \ FileTransfer.conf \ @@ -46,7 +47,8 @@ man_MANS = \ abrt-Bugzilla.7 \ abrt-KerneloopsScanner.7 \ abrt-KerneloopsReporter.7 \ - abrt-Logger.7 abrt-Mailx.7 \ + abrt-Logger.7 \ + abrt-Mailx.7 \ abrt-plugins.7 \ abrt-SQLite3.7 \ abrt-RunApp.7 \ diff --git a/lib/Plugins/RHTSupport.conf b/lib/Plugins/RHTSupport.conf new file mode 100644 index 00000000..3201c6da --- /dev/null +++ b/lib/Plugins/RHTSupport.conf @@ -0,0 +1 @@ +Enabled = yes diff --git a/lib/Plugins/RHTSupport.cpp b/lib/Plugins/RHTSupport.cpp index 01f46f13..c9467a43 100644 --- a/lib/Plugins/RHTSupport.cpp +++ b/lib/Plugins/RHTSupport.cpp @@ -104,6 +104,15 @@ string CReporterRHticket::Report(const map_crash_data_t& pCrashData, { string retval; + map_plugin_settings_t::const_iterator end = pSettings.end(); + map_plugin_settings_t::const_iterator it; + it = pSettings.find("URL"); + string URL = (it == end ? m_sStrataURL : it->second); + it = pSettings.find("Login"); + string login = (it == end ? m_sLogin : it->second); + it = pSettings.find("Password"); + string password = (it == end ? m_sPassword : it->second); + const string& package = get_crash_data_item_content(pCrashData, FILENAME_PACKAGE); // const string& component = get_crash_data_item_content(pCrashData, FILENAME_COMPONENT); // const string& release = get_crash_data_item_content(pCrashData, FILENAME_RELEASE); @@ -220,9 +229,9 @@ string CReporterRHticket::Report(const map_crash_data_t& pCrashData, { update_client(_("Creating a new case...")); - char* result = send_report_to_new_case(m_sStrataURL.c_str(), - m_sLogin.c_str(), - m_sPassword.c_str(), + char* result = send_report_to_new_case(URL.c_str(), + login.c_str(), + password.c_str(), summary.c_str(), description.c_str(), package.c_str(), @@ -234,7 +243,8 @@ string CReporterRHticket::Report(const map_crash_data_t& pCrashData, } ret: - kill(child, SIGKILL); /* just in case */ + // Damn, selinux does not allow SIGKILLing our own child! wtf?? + //kill(child, SIGKILL); /* just in case */ waitpid(child, NULL, 0); if (tar) tar_close(tar); diff --git a/lib/Plugins/TicketUploader.conf b/lib/Plugins/TicketUploader.conf index 97f455c5..57692531 100644 --- a/lib/Plugins/TicketUploader.conf +++ b/lib/Plugins/TicketUploader.conf @@ -1,3 +1,5 @@ +Enabled = yes + # Customer = "Example Inc." # Ticket = IT12345 # Encrypt = yes @@ -17,4 +19,3 @@ # How long we wait between we retry the upload (in seconds) # RetryDelay = 20 -Enabled = yes diff --git a/lib/Utils/abrt_rh_support.cpp b/lib/Utils/abrt_rh_support.cpp index 76a36119..5ff75652 100644 --- a/lib/Utils/abrt_rh_support.cpp +++ b/lib/Utils/abrt_rh_support.cpp @@ -399,14 +399,20 @@ send_report_to_new_case(const char* baseURL, /* fall through */ default: - errmsg = find_header_in_abrt_post_state(case_state, "Strata-Message:"); - if (!errmsg && case_state->body && case_state->body[0]) - errmsg = case_state->body; + errmsg = case_state->curl_error_msg; if (errmsg) - retval = xasprintf("error in case creation, server says: '%s'", errmsg); + retval = xasprintf("error in case creation: %s", errmsg); else - retval = xasprintf("error in case creation, HTTP code: %d", - case_state->http_resp_code); + { + errmsg = find_header_in_abrt_post_state(case_state, "Strata-Message:"); + if ((!errmsg || !errmsg[0]) && case_state->body && case_state->body[0]) + errmsg = case_state->body; + if (errmsg) + retval = xasprintf("error in case creation, server says: '%s'", errmsg); + else + retval = xasprintf("error in case creation, HTTP code: %d", + case_state->http_resp_code); + } break; case 200: @@ -443,7 +449,9 @@ send_report_to_new_case(const char* baseURL, default: /* Case Creation Succeeded, attachement FAILED */ errmsg = find_header_in_abrt_post_state(atch_state, "Strata-Message:"); - if (!errmsg && atch_state->body && atch_state->body[0]) + if (!errmsg || !errmsg[0]) + errmsg = atch_state->curl_error_msg; + if ((!errmsg || !errmsg[0]) && atch_state->body && atch_state->body[0]) errmsg = atch_state->body; if (case_state->body && case_state->body[0]) { diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index d45209a3..7fa9f26b 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -275,14 +275,14 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply) map_map_string_t::const_iterator it_user_conf_data = user_conf_data.begin(); for (; it_user_conf_data != user_conf_data.end(); it_user_conf_data++) { - std::string PluginName = it_user_conf_data->first; - std::cout << "plugin name: " << it_user_conf_data->first; + //std::string PluginName = it_user_conf_data->first; + log("plugin:'%s'", it_user_conf_data->first.c_str()); map_string_t::const_iterator it_plugin_config; for (it_plugin_config = it_user_conf_data->second.begin(); it_plugin_config != it_user_conf_data->second.end(); it_plugin_config++) { - std::cout << " key: " << it_plugin_config->first << " value: " << it_plugin_config->second << std::endl; + log("key:'%s' val:'%s'", it_plugin_config->first.c_str(), it_plugin_config->second.c_str()); } // this would overwrite the default settings //g_pPluginManager->SetPluginSettings(PluginName, sender, plugin_settings); |