summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2009-12-14 10:41:51 +0100
committerKarel Klic <kklic@redhat.com>2009-12-14 10:41:51 +0100
commita24d2906c51e3740e6e0acf8f0093827b4e35bc3 (patch)
tree1022bf70766a88d45dc71d6ea413ccd0fa14d07c /lib
parentb7ea0e53e3375de6298b2f510302f75ebef4be4e (diff)
parent42f0375d09931903965b36c87f17f805def956bf (diff)
downloadabrt-a24d2906c51e3740e6e0acf8f0093827b4e35bc3.tar.gz
abrt-a24d2906c51e3740e6e0acf8f0093827b4e35bc3.tar.xz
abrt-a24d2906c51e3740e6e0acf8f0093827b4e35bc3.zip
Merge branch 'master' of git://git.fedorahosted.org/git/abrt
Diffstat (limited to 'lib')
-rw-r--r--lib/Plugins/Bugzilla.GTKBuilder254
-rw-r--r--lib/Plugins/Bugzilla.cpp8
-rw-r--r--lib/Plugins/Bugzilla.h2
-rw-r--r--lib/Plugins/CCpp.cpp11
-rw-r--r--lib/Plugins/Catcut.GTKBuilder237
-rw-r--r--lib/Plugins/Catcut.cpp2
-rw-r--r--lib/Plugins/Catcut.h2
-rw-r--r--lib/Plugins/FileTransfer.cpp10
-rw-r--r--lib/Plugins/Firefox.cpp6
-rw-r--r--lib/Plugins/KerneloopsReporter.GTKBuilder75
-rw-r--r--lib/Plugins/KerneloopsReporter.cpp11
-rw-r--r--lib/Plugins/KerneloopsReporter.h4
-rw-r--r--lib/Plugins/KerneloopsScanner.cpp2
-rw-r--r--lib/Plugins/KerneloopsSysLog.cpp4
-rw-r--r--lib/Plugins/Logger.GTKBuilder98
-rw-r--r--lib/Plugins/Logger.cpp7
-rw-r--r--lib/Plugins/Logger.h2
-rw-r--r--lib/Plugins/Mailx.GTKBuilder194
-rw-r--r--lib/Plugins/Mailx.cpp5
-rw-r--r--lib/Plugins/Mailx.h2
-rw-r--r--lib/Plugins/Python.cpp16
-rw-r--r--lib/Plugins/SOSreport.cpp7
-rw-r--r--lib/Plugins/SQLite3.cpp8
-rw-r--r--lib/Plugins/TicketUploader.GTKBuilder312
-rw-r--r--lib/Plugins/TicketUploader.cpp18
-rw-r--r--lib/Plugins/TicketUploader.h2
-rw-r--r--lib/Utils/ABRTException.cpp15
-rw-r--r--lib/Utils/CrashTypesSocket.cpp4
-rw-r--r--lib/Utils/DebugDump.cpp28
-rw-r--r--lib/Utils/Makefile.am3
-rw-r--r--lib/Utils/Reporter.h2
-rw-r--r--lib/Utils/abrt_dbus.h22
-rw-r--r--lib/Utils/abrt_xmlrpc.cpp2
-rw-r--r--lib/Utils/logging.cpp11
-rw-r--r--lib/Utils/xfuncs.cpp4
35 files changed, 765 insertions, 625 deletions
diff --git a/lib/Plugins/Bugzilla.GTKBuilder b/lib/Plugins/Bugzilla.GTKBuilder
index 998dc73..95abb71 100644
--- a/lib/Plugins/Bugzilla.GTKBuilder
+++ b/lib/Plugins/Bugzilla.GTKBuilder
@@ -3,7 +3,8 @@
<requires lib="gtk+" version="2.14"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="PluginDialog">
- <property name="border_width">5</property>
+ <property name="border_width">12</property>
+ <property name="resizable">False</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">normal</property>
@@ -12,136 +13,173 @@
<object class="GtkVBox" id="dialog-vbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <property name="spacing">2</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Bugzilla plugin configuration</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <child>
- <object class="GtkLabel" id="lBugzillaURL">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Bugzilla URL</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="lLogin">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Login</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="lPassword">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Password</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_BugzillaURL">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
- <object class="GtkEntry" id="conf_Login">
+ <object class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
+ <property name="n_rows">5</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="lBugzillaURL">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Bugzilla URL:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="lLogin">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Login:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="lPassword">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Password:</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_BugzillaURL">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_Login">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_Password">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="cb_Password">
+ <property name="label" translatable="yes">Show password</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="conf_NoSSLVerify">
+ <property name="label" translatable="yes">No SSL verify</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_Password">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="cb_Password">
- <property name="label" translatable="yes">Show password</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
- <child>
- <placeholder/>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
- <child>
- <object class="GtkCheckButton" id="conf_NoSSLVerify">
- <property name="label" translatable="yes">No SSL verify</property>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Bugzilla plugin configuration&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
</object>
- <packing>
- <property name="position">2</property>
- </packing>
</child>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Don't have an account yet? You can register at https://bugzilla.redhat.com/createaccount.cgi</property>
+ <property name="use_markup">True</property>
+ </object>
+ <packing>
+ <property name="position">2</property>
+ </packing>
+ </child>
<child internal-child="action_area">
<object class="GtkHButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="bApply">
- <property name="label" translatable="yes">gtk-apply</property>
+ <property name="label">gtk-apply</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -155,7 +193,7 @@
</child>
<child>
<object class="GtkButton" id="button2">
- <property name="label" translatable="yes">gtk-cancel</property>
+ <property name="label">gtk-cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp
index f17f9a7..2d065f6 100644
--- a/lib/Plugins/Bugzilla.cpp
+++ b/lib/Plugins/Bugzilla.cpp
@@ -52,7 +52,7 @@ void ctx::login(const char* login, const char* passwd)
std::string errmsg = ssprintf("Can't login. Check Edit->Plugins->Bugzilla and /etc/abrt/plugins/Bugzilla.conf. Server said: %s", env.fault_string);
xmlrpc_env_clean(&env);
error_msg("%s", errmsg.c_str()); // show error in daemon log
- throw CABRTException(EXCEP_PLUGIN, errmsg);
+ throw CABRTException(EXCEP_PLUGIN, errmsg.c_str());
}
}
@@ -287,7 +287,7 @@ void ctx::add_attachments(const char* bug_id_str, const map_crash_report_t& pCra
if (type == CD_ATT)
{
char *encoded64 = encode_base64(content.c_str(), content.length());
- xmlrpc_value* param = xmlrpc_build_value(&env,"(s{s:s,s:s,s:s,s:s})",
+ xmlrpc_value* param = xmlrpc_build_value(&env, "(s{s:s,s:s,s:s,s:s})",
bug_id_str,
"description", ("File: " + filename).c_str(),
"filename", filename.c_str(),
@@ -323,7 +323,7 @@ CReporterBugzilla::~CReporterBugzilla()
std::string CReporterBugzilla::Report(const map_crash_report_t& pCrashReport,
const map_plugin_settings_t& pSettings,
- const std::string& pArgs)
+ const char *pArgs)
{
int32_t bug_id = -1;
std::string Login;
@@ -483,7 +483,7 @@ void CReporterBugzilla::SetSettings(const map_plugin_settings_t& pSettings)
m_sBugzillaURL.erase(m_sBugzillaURL.length() - 1);
}
/*
- if(*(--m_sBugzillaURL.end()) == '/')
+ if (*(--m_sBugzillaURL.end()) == '/')
{
m_sBugzillaURL.erase(--m_sBugzillaURL.end());
}
diff --git a/lib/Plugins/Bugzilla.h b/lib/Plugins/Bugzilla.h
index 9130a69..ee6bc6a 100644
--- a/lib/Plugins/Bugzilla.h
+++ b/lib/Plugins/Bugzilla.h
@@ -22,7 +22,7 @@ class CReporterBugzilla : public CReporter
virtual std::string Report(const map_crash_report_t& pCrashReport,
const map_plugin_settings_t& pSettings,
- const std::string& pArgs);
+ const char *pArgs);
virtual void SetSettings(const map_plugin_settings_t& pSettings);
virtual const map_plugin_settings_t& GetSettings();
diff --git a/lib/Plugins/CCpp.cpp b/lib/Plugins/CCpp.cpp
index 5d344c0..add4e50 100644
--- a/lib/Plugins/CCpp.cpp
+++ b/lib/Plugins/CCpp.cpp
@@ -277,7 +277,7 @@ static void GetBacktrace(const char *pDebugDumpDir,
unsetenv("TERM");
putenv((char*)"TERM=dumb");
- char *args[11];
+ char *args[13];
args[0] = (char*)"gdb";
args[1] = (char*)"-batch";
@@ -315,7 +315,9 @@ static void GetBacktrace(const char *pDebugDumpDir,
args[8] = (char*)"-ex";
args[9] = (char*)"thread apply all backtrace full";
- args[10] = NULL;
+ args[10] = (char*)"-ex";
+ args[11] = (char*)"info sharedlib";
+ args[12] = NULL;
ExecVP(args, atoi(UID.c_str()), pBacktrace);
}
@@ -433,6 +435,7 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
build_ids += "Debuginfo absent: ";
build_ids += buff + 8;
build_ids += "\n";
+ continue;
}
const char *p = buff;
@@ -442,7 +445,7 @@ static void InstallDebugInfos(const char *pDebugDumpDir,
}
if (*p)
{
- log("%s", buff);
+ VERB1 log("%s", buff);
update_client("%s", buff);
}
}
@@ -654,8 +657,6 @@ static bool DebuginfoCheckPolkit(int uid)
void CAnalyzerCCpp::CreateReport(const char *pDebugDumpDir, int force)
{
- update_client(_("Starting report creation..."));
-
string package;
string backtrace;
string UID;
diff --git a/lib/Plugins/Catcut.GTKBuilder b/lib/Plugins/Catcut.GTKBuilder
index b8c7c31..9f314f0 100644
--- a/lib/Plugins/Catcut.GTKBuilder
+++ b/lib/Plugins/Catcut.GTKBuilder
@@ -3,7 +3,8 @@
<requires lib="gtk+" version="2.16"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="PluginDialog">
- <property name="border_width">5</property>
+ <property name="border_width">12</property>
+ <property name="resizable">False</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">normal</property>
@@ -12,126 +13,150 @@
<object class="GtkVBox" id="dialog-vbox3">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <property name="spacing">2</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Catcut plugin configuration</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <child>
- <object class="GtkLabel" id="lCatcutURL">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Catcut URL</property>
- </object>
- </child>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
- <object class="GtkLabel" id="lLogin">
+ <object class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Login</property>
+ <property name="n_rows">5</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="lCatcutURL">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Catcut URL:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="lLogin">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Login:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="lPassword">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Password:</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_CatcutURL">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_Login">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_Password">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="visibility">False</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="cb_Password">
+ <property name="label" translatable="yes">Show password</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="conf_NoSSLVerify">
+ <property name="label" translatable="yes">No SSL verify</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
</object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="lPassword">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Password</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_CatcutURL">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_Login">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_Password">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="cb_Password">
- <property name="label" translatable="yes">Show password</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
- <child>
- <placeholder/>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
- <child>
- <object class="GtkCheckButton" id="conf_NoSSLVerify">
- <property name="label" translatable="yes">No SSL verify</property>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Catcut plugin configuration&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
</object>
- <packing>
- <property name="position">2</property>
- </packing>
</child>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp
index 7add58c..9974faa 100644
--- a/lib/Plugins/Catcut.cpp
+++ b/lib/Plugins/Catcut.cpp
@@ -436,7 +436,7 @@ CReporterCatcut::~CReporterCatcut()
string CReporterCatcut::Report(const map_crash_report_t& pCrashReport,
const map_plugin_settings_t& pSettings,
- const string& pArgs)
+ const char *pArgs)
{
update_client(_("Creating new bug..."));
try
diff --git a/lib/Plugins/Catcut.h b/lib/Plugins/Catcut.h
index 4fb89e2..00f486c 100644
--- a/lib/Plugins/Catcut.h
+++ b/lib/Plugins/Catcut.h
@@ -22,7 +22,7 @@ class CReporterCatcut : public CReporter
virtual std::string Report(const map_crash_report_t& pCrashReport,
const map_plugin_settings_t& pSettings,
- const std::string& pArgs);
+ const char *Args);
};
#endif /* CATCUT_H_ */
diff --git a/lib/Plugins/FileTransfer.cpp b/lib/Plugins/FileTransfer.cpp
index 868f54d..03ee464 100644
--- a/lib/Plugins/FileTransfer.cpp
+++ b/lib/Plugins/FileTransfer.cpp
@@ -79,12 +79,12 @@ void CFileTransfer::SendFile(const char *pURL, const char *pFilename)
f = fopen(pFilename, "r");
if (!f)
{
- throw CABRTException(EXCEP_PLUGIN, ssprintf("Can't open archive file '%s'", pFilename));
+ throw CABRTException(EXCEP_PLUGIN, "Can't open archive file '%s'", pFilename);
}
if (fstat(fileno(f), &buf) == -1)
{
fclose(f);
- throw CABRTException(EXCEP_PLUGIN, ssprintf("Can't stat archive file '%s'", pFilename));
+ throw CABRTException(EXCEP_PLUGIN, "Can't stat archive file '%s'", pFilename);
}
curl = curl_easy_init();
if (!curl)
@@ -114,7 +114,7 @@ now used in create_zip, but can be useful for some future
archivers as well
*/
static void traverse_directory(const char * directory, void * something,
- void (*func)(void *,const char *) )
+ void (*func)(void *, const char *) )
{
DIR * dp;
struct dirent * dirp;
@@ -225,7 +225,7 @@ static void create_tarbz2(const char * archive_name, const char * directory)
#define BLOCK_MULTIPLIER 7
name_without_bz2 = xstrdup(archive_name);
- strrchr(name_without_bz2,'.')[0] = '\0';
+ strrchr(name_without_bz2, '.')[0] = '\0';
create_tar(name_without_bz2, directory);
tarFD = open(name_without_bz2, O_RDONLY);
@@ -282,7 +282,7 @@ void CFileTransfer::CreateArchive(const char *pArchiveName, const char *pDir)
}
else
{
- throw CABRTException(EXCEP_PLUGIN, "Unknown/unsupported archive type " + m_sArchiveType);
+ throw CABRTException(EXCEP_PLUGIN, "Unknown/unsupported archive type %s", m_sArchiveType.c_str());
}
}
diff --git a/lib/Plugins/Firefox.cpp b/lib/Plugins/Firefox.cpp
index 68dbd39..6f2c60d 100644
--- a/lib/Plugins/Firefox.cpp
+++ b/lib/Plugins/Firefox.cpp
@@ -100,7 +100,7 @@ static pid_t ExecVP(char** pArgs, uid_t uid, std::string& pOutput)
struct passwd* pw = getpwuid(uid);
if (!pw)
{
- throw CABRTException(EXCEP_PLUGIN, std::string(__func__) + ": cannot get GID for UID.");
+ throw CABRTException(EXCEP_PLUGIN, "%s: can't get GID for UID", __func__);
}
xpipe(pipeout);
@@ -662,7 +662,7 @@ Another application is holding the yum lock, cannot continue
fclose(pipeout_fp);
kill(child, SIGTERM);
wait(NULL);
- throw CABRTException(EXCEP_PLUGIN, std::string(__func__) + ": cannot install debuginfos for " + pPackage);
+ throw CABRTException(EXCEP_PLUGIN, "%s: can't install debuginfos for %s", __func__, pPackage);
}
#endif
}
@@ -879,8 +879,6 @@ static bool DebuginfoCheckPolkit(int uid)
void CAnalyzerFirefox::CreateReport(const char *pDebugDumpDir, int force)
{
- update_client(_("Starting report creation..."));
-
std::string package;
std::string backtrace;
std::string UID;
diff --git a/lib/Plugins/KerneloopsReporter.GTKBuilder b/lib/Plugins/KerneloopsReporter.GTKBuilder
index 74cb36b..65f993f 100644
--- a/lib/Plugins/KerneloopsReporter.GTKBuilder
+++ b/lib/Plugins/KerneloopsReporter.GTKBuilder
@@ -3,55 +3,68 @@
<requires lib="gtk+" version="2.14"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="PluginDialog">
- <property name="border_width">5</property>
+ <property name="border_width">12</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
<property name="type_hint">normal</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <property name="spacing">2</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Kerneloops Reporter plugin configuration</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_columns">2</property>
- <child>
- <object class="GtkLabel" id="lSubmitURL">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Submit URL</property>
- </object>
- </child>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
- <object class="GtkEntry" id="conf_SubmitURL">
+ <object class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="lSubmitURL">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Submit URL:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_SubmitURL">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Kerneloops Reporter plugin configuration&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
+ </object>
</child>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
diff --git a/lib/Plugins/KerneloopsReporter.cpp b/lib/Plugins/KerneloopsReporter.cpp
index a1fd3f1..26430be 100644
--- a/lib/Plugins/KerneloopsReporter.cpp
+++ b/lib/Plugins/KerneloopsReporter.cpp
@@ -95,7 +95,7 @@ CKerneloopsReporter::CKerneloopsReporter() :
std::string CKerneloopsReporter::Report(const map_crash_report_t& pCrashReport,
const map_plugin_settings_t& pSettings,
- const std::string& pArgs)
+ const char *pArgs)
{
int ret = -1;
@@ -111,9 +111,14 @@ std::string CKerneloopsReporter::Report(const map_crash_report_t& pCrashReport,
if (ret) {
/* FIXME: be more informative */
- throw CABRTException(EXCEP_PLUGIN, std::string("CKerneloopsReporter::Report(): Report has not been sent..."));
+ throw CABRTException(EXCEP_PLUGIN, "CKerneloopsReporter::Report(): Report has not been sent");
}
- return "Kernel oops report was uploaded.";
+ /* Server replies with:
+ * 200 thank you for submitting the kernel oops information
+ * RemoteIP: 34192fd15e34bf60fac6a5f01bba04ddbd3f0558
+ * - no URL or bug ID apparently...
+ */
+ return "Kernel oops report was uploaded";
}
void CKerneloopsReporter::SetSettings(const map_plugin_settings_t& pSettings)
diff --git a/lib/Plugins/KerneloopsReporter.h b/lib/Plugins/KerneloopsReporter.h
index af82afb..10e5e64 100644
--- a/lib/Plugins/KerneloopsReporter.h
+++ b/lib/Plugins/KerneloopsReporter.h
@@ -44,8 +44,8 @@ class CKerneloopsReporter : public CReporter
//ok to delete?
// virtual const map_plugin_settings_t& GetSettings();
virtual std::string Report(const map_crash_report_t& pCrashReport,
- const map_plugin_settings_t& pSettings,
- const std::string& pArgs);
+ const map_plugin_settings_t& pSettings,
+ const char *pArgs);
};
#endif
diff --git a/lib/Plugins/KerneloopsScanner.cpp b/lib/Plugins/KerneloopsScanner.cpp
index 3831f9e..128e083 100644
--- a/lib/Plugins/KerneloopsScanner.cpp
+++ b/lib/Plugins/KerneloopsScanner.cpp
@@ -109,7 +109,7 @@ void CKerneloopsScanner::SaveOopsToDebugDump()
}
catch (CABRTException& e)
{
- throw CABRTException(EXCEP_PLUGIN, std::string(__func__) + ": " + e.what());
+ throw CABRTException(EXCEP_PLUGIN, "%s: %s", __func__, e.what());
}
oopsList.pop_back();
}
diff --git a/lib/Plugins/KerneloopsSysLog.cpp b/lib/Plugins/KerneloopsSysLog.cpp
index fdb4a02..adff846 100644
--- a/lib/Plugins/KerneloopsSysLog.cpp
+++ b/lib/Plugins/KerneloopsSysLog.cpp
@@ -52,7 +52,9 @@ static int extract_version(const char *linepointer, char *version)
start = strstr((char*)linepointer, "2.6.");
if (start) {
- end = strchrnul(start, ' ');
+ end = strchr(start, ')');
+ if (!end)
+ end = strchrnul(start, ' ');
strncpy(version, start, end-start);
ret = 1;
}
diff --git a/lib/Plugins/Logger.GTKBuilder b/lib/Plugins/Logger.GTKBuilder
index a6b82c0..26ac10f 100644
--- a/lib/Plugins/Logger.GTKBuilder
+++ b/lib/Plugins/Logger.GTKBuilder
@@ -3,67 +3,85 @@
<requires lib="gtk+" version="2.14"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="PluginDialog">
- <property name="border_width">5</property>
+ <property name="border_width">12</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="window_position">center-on-parent</property>
<property name="type_hint">normal</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <property name="spacing">2</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Logger plugin configuration</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_columns">2</property>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
- <object class="GtkLabel" id="lLogPath">
+ <object class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Logger file</property>
+ <property name="n_rows">2</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="lLogPath">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Logger file:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_LogPath">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="conf_AppendLogs">
+ <property name="label" translatable="yes">Append new logs</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
</object>
</child>
- <child>
- <object class="GtkEntry" id="conf_LogPath">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
- <child>
- <object class="GtkCheckButton" id="conf_AppendLogs">
- <property name="label" translatable="yes">Append new logs</property>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Logger plugin configuration&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
</object>
- <packing>
- <property name="position">2</property>
- </packing>
</child>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp
index 7267b64..a0dea42 100644
--- a/lib/Plugins/Logger.cpp
+++ b/lib/Plugins/Logger.cpp
@@ -60,9 +60,9 @@ void CLogger::SetSettings(const map_plugin_settings_t& pSettings)
//}
std::string CLogger::Report(const map_crash_report_t& pCrashReport,
- const map_plugin_settings_t& pSettings, const std::string& pArgs)
+ const map_plugin_settings_t& pSettings,
+ const char *pArgs)
{
- update_client(_("Creating a report..."));
std::string description = make_description_logger(pCrashReport);
description += "\n\n\n";
@@ -79,12 +79,13 @@ std::string CLogger::Report(const map_crash_report_t& pCrashReport,
if (fOut)
{
+ update_client(_("Writing report to '%s'"), m_sLogPath.c_str());
fputs(description.c_str(), fOut);
fclose(fOut);
return "file://" + m_sLogPath;
}
- throw CABRTException(EXCEP_PLUGIN, "CLogger::Report(): Cannot open file: " + m_sLogPath);
+ throw CABRTException(EXCEP_PLUGIN, "Can't open '%s'", m_sLogPath.c_str());
}
PLUGIN_INFO(REPORTER,
diff --git a/lib/Plugins/Logger.h b/lib/Plugins/Logger.h
index 285e25b..c7d7679 100644
--- a/lib/Plugins/Logger.h
+++ b/lib/Plugins/Logger.h
@@ -39,7 +39,7 @@ class CLogger : public CReporter
// virtual const map_plugin_settings_t& GetSettings();
virtual std::string Report(const map_crash_report_t& pCrashReport,
const map_plugin_settings_t& pSettings,
- const std::string& pArgs);
+ const char *pArgs);
};
#endif /* LOGGER_H_ */
diff --git a/lib/Plugins/Mailx.GTKBuilder b/lib/Plugins/Mailx.GTKBuilder
index a823eca..55647e1 100644
--- a/lib/Plugins/Mailx.GTKBuilder
+++ b/lib/Plugins/Mailx.GTKBuilder
@@ -3,114 +3,134 @@
<requires lib="gtk+" version="2.14"/>
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="PluginDialog">
- <property name="border_width">5</property>
+ <property name="border_width">12</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="window_position">center-on-parent</property>
<property name="type_hint">normal</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
<object class="GtkVBox" id="dialog-vbox">
<property name="visible">True</property>
<property name="orientation">vertical</property>
- <property name="spacing">2</property>
+ <property name="spacing">12</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Mailx plugin configuration</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <child>
- <object class="GtkLabel" id="lSubject">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Subject:</property>
- </object>
- </child>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
- <object class="GtkEntry" id="conf_Subject">
+ <object class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
+ <property name="n_rows">4</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="lSubject">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Subject:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_Subject">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_EmailFrom">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="lEmailFrom">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Your Email:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="lEmailTo">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Recipient's Email:</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_EmailTo">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="conf_SendBinaryData">
+ <property name="label" translatable="yes">Send Binary Data</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_EmailFrom">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="lEmailFrom">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Your Email:</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="lEmailTo">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Recipient's Email:</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_EmailTo">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
</child>
- <child>
- <object class="GtkCheckButton" id="conf_SendBinaryData">
- <property name="label" translatable="yes">Send Binary Data</property>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Mailx plugin configuration&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
</object>
- <packing>
- <property name="position">2</property>
- </packing>
</child>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp
index dc6e2b0..26b6ec4 100644
--- a/lib/Plugins/Mailx.cpp
+++ b/lib/Plugins/Mailx.cpp
@@ -84,7 +84,8 @@ static char** append_str_to_vector(char **vec, unsigned &size, const char *str)
}
std::string CMailx::Report(const map_crash_report_t& pCrashReport,
- const map_plugin_settings_t& pSettings, const std::string& pArgs)
+ const map_plugin_settings_t& pSettings,
+ const char *pArgs)
{
char **args = NULL;
unsigned arg_size = 0;
@@ -156,7 +157,7 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport,
emailBody += '\n';
args = append_str_to_vector(args, arg_size, "-s");
- args = append_str_to_vector(args, arg_size, (pArgs != "" ? pArgs.c_str() : m_sSubject.c_str()));
+ args = append_str_to_vector(args, arg_size, (pArgs[0] != '\0' ? pArgs : m_sSubject.c_str()));
args = append_str_to_vector(args, arg_size, "-r");
args = append_str_to_vector(args, arg_size, m_sEmailFrom.c_str());
args = append_str_to_vector(args, arg_size, m_sEmailTo.c_str());
diff --git a/lib/Plugins/Mailx.h b/lib/Plugins/Mailx.h
index d6d66bd..1ddb5ff 100644
--- a/lib/Plugins/Mailx.h
+++ b/lib/Plugins/Mailx.h
@@ -43,7 +43,7 @@ class CMailx : public CReporter
// virtual const map_plugin_settings_t& GetSettings();
virtual std::string Report(const map_crash_report_t& pCrashReport,
const map_plugin_settings_t& pSettings,
- const std::string& pArgs);
+ const char *pArgs);
};
#endif
diff --git a/lib/Plugins/Python.cpp b/lib/Plugins/Python.cpp
index a5e9909..906e815 100644
--- a/lib/Plugins/Python.cpp
+++ b/lib/Plugins/Python.cpp
@@ -4,7 +4,6 @@
#include "ABRTException.h"
#define FILENAME_BACKTRACE "backtrace"
-#define PYHOOK_CONFIG "/etc/abrt/pyhook.conf"
static std::string CreateHash(const char *pDebugDumpDir)
{
@@ -26,25 +25,10 @@ std::string CAnalyzerPython::GetGlobalUUID(const char *pDebugDumpDir)
void CAnalyzerPython::Init()
{
- std::ofstream fOutPySiteCustomize;
- fOutPySiteCustomize.open(PYHOOK_CONFIG);
- if (fOutPySiteCustomize.is_open())
- {
- fOutPySiteCustomize << "enabled = yes" << std::endl;
- fOutPySiteCustomize.close();
- }
}
void CAnalyzerPython::DeInit()
{
- // TODO: remove copied abrt exception handler
- std::ofstream fOutPySiteCustomize;
- fOutPySiteCustomize.open(PYHOOK_CONFIG);
- if (fOutPySiteCustomize.is_open())
- {
- fOutPySiteCustomize << "enabled = no" << std::endl;
- fOutPySiteCustomize.close();
- }
}
PLUGIN_INFO(ANALYZER,
diff --git a/lib/Plugins/SOSreport.cpp b/lib/Plugins/SOSreport.cpp
index 65d01a7..6f23165 100644
--- a/lib/Plugins/SOSreport.cpp
+++ b/lib/Plugins/SOSreport.cpp
@@ -104,10 +104,9 @@ void CActionSOSreport::Run(const char *pActionDir, const char *pArgs)
if (copy_file(sosreport_filename.c_str(), sosreport_dd_filename.c_str()) < 0)
{
throw CABRTException(EXCEP_PLUGIN,
- ssprintf("Can't copy '%s' to '%s'",
- sosreport_filename.c_str(),
- sosreport_dd_filename.c_str()
- )
+ "Can't copy '%s' to '%s'",
+ sosreport_filename.c_str(),
+ sosreport_dd_filename.c_str()
);
}
}
diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp
index 866b985..d95c273 100644
--- a/lib/Plugins/SQLite3.cpp
+++ b/lib/Plugins/SQLite3.cpp
@@ -107,7 +107,7 @@ static void get_table(vector_database_rows_t& pTable,
string errstr = ssprintf("Error in SQL:'%s' error: %s", sql, err);
free(sql);
sqlite3_free(err);
- throw CABRTException(EXCEP_PLUGIN, errstr);
+ throw CABRTException(EXCEP_PLUGIN, errstr.c_str());
}
VERB2 log("%d rows returned by SQL:%s", nrow, sql);
free(sql);
@@ -152,7 +152,7 @@ static void execute_sql(sqlite3 *db, const char *fmt, ...)
string errstr = ssprintf("Error in SQL:'%s' error: %s", sql, err);
free(sql);
sqlite3_free(err);
- throw CABRTException(EXCEP_PLUGIN, errstr);
+ throw CABRTException(EXCEP_PLUGIN, errstr.c_str());
}
VERB2 log("%d rows affected by SQL:%s", sqlite3_changes(db), sql);
free(sql);
@@ -262,7 +262,7 @@ void CSQLite3::Connect()
{
if (ret != SQLITE_CANTOPEN)
{
- throw CABRTException(EXCEP_PLUGIN, ssprintf("CheckDB: Can't open database: %s", sqlite3_errmsg(m_pDB)));
+ throw CABRTException(EXCEP_PLUGIN, "Can't open database: %s", sqlite3_errmsg(m_pDB));
}
ret = sqlite3_open_v2(m_sDBPath.c_str(),
@@ -272,7 +272,7 @@ void CSQLite3::Connect()
);
if (ret != SQLITE_OK)
{
- throw CABRTException(EXCEP_PLUGIN, ssprintf("Can't create database: %s", sqlite3_errmsg(m_pDB)));
+ throw CABRTException(EXCEP_PLUGIN, "Can't create database: %s", sqlite3_errmsg(m_pDB));
}
}
diff --git a/lib/Plugins/TicketUploader.GTKBuilder b/lib/Plugins/TicketUploader.GTKBuilder
index 7865e89..4695a31 100644
--- a/lib/Plugins/TicketUploader.GTKBuilder
+++ b/lib/Plugins/TicketUploader.GTKBuilder
@@ -4,6 +4,9 @@
<!-- interface-naming-policy project-wide -->
<object class="GtkDialog" id="PluginDialog">
<property name="border_width">5</property>
+ <property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="window_position">center-on-parent</property>
<property name="type_hint">normal</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
@@ -12,163 +15,186 @@
<property name="orientation">vertical</property>
<property name="spacing">2</property>
<child>
- <object class="GtkVBox" id="vbox1">
+ <object class="GtkFrame" id="frame1">
<property name="visible">True</property>
- <property name="orientation">vertical</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">none</property>
<child>
- <object class="GtkLabel" id="label1">
+ <object class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
- <property name="label" translatable="yes">Ticket Uploader plugin configuration</property>
- </object>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="n_rows">5</property>
- <property name="n_columns">2</property>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Customer</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Ticket</property>
- </object>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="label" translatable="yes">URL</property>
- </object>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_Customer">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_Ticket">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_URL">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Retry count</property>
- </object>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
+ <property name="top_padding">6</property>
+ <property name="left_padding">12</property>
<child>
- <object class="GtkEntry" id="conf_RetryCount">
+ <object class="GtkTable" id="table1">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
+ <property name="n_rows">7</property>
+ <property name="n_columns">2</property>
+ <property name="column_spacing">12</property>
+ <property name="row_spacing">6</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Customer:</property>
+ </object>
+ <packing>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Ticket:</property>
+ </object>
+ <packing>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">URL:</property>
+ </object>
+ <packing>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_Customer">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_Ticket">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">1</property>
+ <property name="bottom_attach">2</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_URL">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">2</property>
+ <property name="bottom_attach">3</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Retry count:</property>
+ </object>
+ <packing>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_RetryCount">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">3</property>
+ <property name="bottom_attach">4</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Retry delay:</property>
+ </object>
+ <packing>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ <property name="x_options">GTK_FILL</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkEntry" id="conf_RetryDelay">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">&#x25CF;</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="right_attach">2</property>
+ <property name="top_attach">4</property>
+ <property name="bottom_attach">5</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="conf_Encrypt">
+ <property name="label" translatable="yes">Use encryption</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">5</property>
+ <property name="bottom_attach">6</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="conf_Upload">
+ <property name="label" translatable="yes">Upload</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">False</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="right_attach">2</property>
+ <property name="top_attach">6</property>
+ <property name="bottom_attach">7</property>
+ </packing>
+ </child>
</object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label6">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Retry delay</property>
- </object>
- <packing>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="conf_RetryDelay">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">&#x25CF;</property>
- </object>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- </packing>
</child>
</object>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="conf_Encrypt">
- <property name="label" translatable="yes">Use encryption</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="position">2</property>
- </packing>
</child>
- <child>
- <object class="GtkCheckButton" id="conf_Upload">
- <property name="label" translatable="yes">Upload</property>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="draw_indicator">True</property>
+ <property name="label" translatable="yes">&lt;b&gt;Ticket Uploader plugin configuration&lt;/b&gt;</property>
+ <property name="use_markup">True</property>
</object>
- <packing>
- <property name="position">3</property>
- </packing>
</child>
</object>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">1</property>
</packing>
</child>
diff --git a/lib/Plugins/TicketUploader.cpp b/lib/Plugins/TicketUploader.cpp
index 847efdc..aa6d412 100644
--- a/lib/Plugins/TicketUploader.cpp
+++ b/lib/Plugins/TicketUploader.cpp
@@ -117,12 +117,12 @@ void CTicketUploader::SendFile(const char *pURL, const char *pFilename)
FILE* f = fopen(pFilename, "r");
if (!f)
{
- throw CABRTException(EXCEP_PLUGIN, ssprintf("Can't open archive file '%s'", pFilename));
+ throw CABRTException(EXCEP_PLUGIN, "Can't open archive file '%s'", pFilename);
}
struct stat buf;
- if (fstat(fileno(f), &buf) == -1)
+ if (fstat(fileno(f), &buf) == -1) /* TODO: never fails */
{
- throw CABRTException(EXCEP_PLUGIN, ssprintf("Can't stat archive file '%s'", pFilename));
+ throw CABRTException(EXCEP_PLUGIN, "Can't stat archive file '%s'", pFilename);
}
CURL* curl = curl_easy_init();
if (!curl)
@@ -156,7 +156,8 @@ void CTicketUploader::SendFile(const char *pURL, const char *pFilename)
string CTicketUploader::Report(const map_crash_report_t& pCrashReport,
- const map_plugin_settings_t& pSettings, const string& pArgs)
+ const map_plugin_settings_t& pSettings,
+ const char *pArgs)
{
update_client(_("Creating an TicketUploader report..."));
@@ -197,7 +198,7 @@ string CTicketUploader::Report(const map_crash_report_t& pCrashReport,
}
string tmptar_name = concat_path_file(tmpdir_name, file_name.c_str());
- if (mkdir(tmptar_name.c_str(),S_IRWXU))
+ if (mkdir(tmptar_name.c_str(), S_IRWXU))
{
Error(ssprintf("Can't mkdir '%s'", tmptar_name.c_str()).c_str());
}
@@ -225,10 +226,9 @@ string CTicketUploader::Report(const map_crash_report_t& pCrashReport,
if (copy_file(it->second[CD_CONTENT].c_str(), ofile_name.c_str()) < 0)
{
throw CABRTException(EXCEP_PLUGIN,
- ssprintf("Can't copy '%s' to '%s'",
- it->second[CD_CONTENT].c_str(),
- ofile_name.c_str()
- )
+ "Can't copy '%s' to '%s'",
+ it->second[CD_CONTENT].c_str(),
+ ofile_name.c_str()
);
}
}
diff --git a/lib/Plugins/TicketUploader.h b/lib/Plugins/TicketUploader.h
index 2a7c98a..e00596f 100644
--- a/lib/Plugins/TicketUploader.h
+++ b/lib/Plugins/TicketUploader.h
@@ -51,7 +51,7 @@ class CTicketUploader : public CReporter
virtual std::string Report(const map_crash_report_t& pCrashReport,
const map_plugin_settings_t& pSettings,
- const std::string& pArgs);
+ const char *pArgs);
};
#endif
diff --git a/lib/Utils/ABRTException.cpp b/lib/Utils/ABRTException.cpp
new file mode 100644
index 0000000..aa6c99d
--- /dev/null
+++ b/lib/Utils/ABRTException.cpp
@@ -0,0 +1,15 @@
+#include "ABRTException.h"
+
+CABRTException::CABRTException(abrt_exception_t type, const char* fmt, ...)
+{
+ m_type = type;
+ va_list ap;
+ va_start(ap, fmt);
+ m_what = xvasprintf(fmt, ap);
+ va_end(ap);
+}
+
+CABRTException::CABRTException(const CABRTException& rhs):
+ m_type(rhs.m_type),
+ m_what(xstrdup(rhs.m_what))
+{}
diff --git a/lib/Utils/CrashTypesSocket.cpp b/lib/Utils/CrashTypesSocket.cpp
index 7c206de..f16e2a9 100644
--- a/lib/Utils/CrashTypesSocket.cpp
+++ b/lib/Utils/CrashTypesSocket.cpp
@@ -73,7 +73,7 @@ std::string crash_data_to_string(const map_crash_data_t& pCrashData)
std::stringstream sCD;
map_crash_data_t::const_iterator it_cd;
sCD << "(" << pCrashData.size() << ")";
- for(it_cd = pCrashData.begin(); it_cd != pCrashData.end(); it_cd++)
+ for (it_cd = pCrashData.begin(); it_cd != pCrashData.end(); it_cd++)
{
sCD << "(" << it_cd->first.length() << ")";
sCD << it_cd->first;
@@ -150,7 +150,7 @@ map_crash_data_t string_to_crash_data(const std::string& pMessage, int& len)
sField = message.substr(ii, nSize);
message.erase(0, ii + nSize);
len += ii + nSize;
- switch(nField % 4)
+ switch (nField % 4)
{
case 0:
name = sField;
diff --git a/lib/Utils/DebugDump.cpp b/lib/Utils/DebugDump.cpp
index 3e226f9..765b514 100644
--- a/lib/Utils/DebugDump.cpp
+++ b/lib/Utils/DebugDump.cpp
@@ -77,7 +77,7 @@ void CDebugDump::Open(const char *pDir)
m_sDebugDumpDir = RemoveBackSlashes(pDir);
if (!ExistFileDir(m_sDebugDumpDir.c_str()))
{
- throw CABRTException(EXCEP_DD_OPEN, m_sDebugDumpDir + " does not exist");
+ throw CABRTException(EXCEP_DD_OPEN, "'%s' does not exist", m_sDebugDumpDir.c_str());
}
Lock();
m_bOpened = true;
@@ -197,7 +197,7 @@ void CDebugDump::Lock()
sprintf(pid_buf, "%u", (unsigned)getpid());
while ((m_bLocked = GetAndSetLock(lockFile.c_str(), pid_buf)) != true)
{
- usleep(500000);
+ sleep(1); /* was 0.5 seconds */
}
}
@@ -222,7 +222,7 @@ void CDebugDump::Create(const char *pDir, int64_t uid)
m_sDebugDumpDir = RemoveBackSlashes(pDir);
if (ExistFileDir(m_sDebugDumpDir.c_str()))
{
- throw CABRTException(EXCEP_DD_OPEN, ssprintf("'%s' already exists", m_sDebugDumpDir.c_str()));
+ throw CABRTException(EXCEP_DD_OPEN, "'%s' already exists", m_sDebugDumpDir.c_str());
}
Lock();
@@ -232,13 +232,13 @@ void CDebugDump::Create(const char *pDir, int64_t uid)
{
UnLock();
m_bOpened = false;
- throw CABRTException(EXCEP_DD_OPEN, ssprintf("Can't create dir '%s'", pDir));
+ throw CABRTException(EXCEP_DD_OPEN, "Can't create dir '%s'", pDir);
}
if (chmod(m_sDebugDumpDir.c_str(), 0700) == -1)
{
UnLock();
m_bOpened = false;
- throw CABRTException(EXCEP_DD_OPEN, ssprintf("Can't change mode of '%s'", pDir));
+ throw CABRTException(EXCEP_DD_OPEN, "Can't change mode of '%s'", pDir);
}
struct passwd* pw = getpwuid(uid);
gid_t gid = pw ? pw->pw_gid : uid;
@@ -272,7 +272,7 @@ static void DeleteFileDir(const char *pDir)
if (errno != EISDIR)
{
closedir(dir);
- throw CABRTException(EXCEP_DD_DELETE, ssprintf("Can't remove dir %s", fullPath.c_str()));
+ throw CABRTException(EXCEP_DD_DELETE, "Can't remove dir %s", fullPath.c_str());
}
DeleteFileDir(fullPath.c_str());
}
@@ -280,7 +280,7 @@ static void DeleteFileDir(const char *pDir)
closedir(dir);
if (remove(pDir) == -1)
{
- throw CABRTException(EXCEP_DD_DELETE, ssprintf("Can't remove dir %s", pDir));
+ throw CABRTException(EXCEP_DD_DELETE, "Can't remove dir %s", pDir);
}
}
@@ -325,7 +325,7 @@ static void LoadTextFile(const char *pPath, std::string& pData)
FILE *fp = fopen(pPath, "r");
if (!fp)
{
- throw CABRTException(EXCEP_DD_LOAD, ssprintf("Can't open file '%s'", pPath));
+ throw CABRTException(EXCEP_DD_LOAD, "Can't open file '%s'", pPath);
}
pData = "";
int ch;
@@ -348,13 +348,13 @@ static void SaveBinaryFile(const char *pPath, const char* pData, unsigned pSize)
int fd = open(pPath, O_WRONLY | O_TRUNC | O_CREAT, 0666);
if (fd < 0)
{
- throw CABRTException(EXCEP_DD_SAVE, ssprintf("Can't open file '%s'", pPath));
+ throw CABRTException(EXCEP_DD_SAVE, "Can't open file '%s'", pPath);
}
unsigned r = full_write(fd, pData, pSize);
close(fd);
if (r != pSize)
{
- throw CABRTException(EXCEP_DD_SAVE, ssprintf("Can't save file '%s'", pPath));
+ throw CABRTException(EXCEP_DD_SAVE, "Can't save file '%s'", pPath);
}
}
@@ -362,7 +362,7 @@ void CDebugDump::LoadText(const char* pName, std::string& pData)
{
if (!m_bOpened)
{
- throw CABRTException(EXCEP_DD_OPEN, "CDebugDump::LoadText(): DebugDump is not opened.");
+ throw CABRTException(EXCEP_DD_OPEN, "DebugDump is not opened");
}
std::string fullPath = concat_path_file(m_sDebugDumpDir.c_str(), pName);
LoadTextFile(fullPath.c_str(), pData);
@@ -372,7 +372,7 @@ void CDebugDump::SaveText(const char* pName, const char* pData)
{
if (!m_bOpened)
{
- throw CABRTException(EXCEP_DD_OPEN, "CDebugDump::SaveText(): DebugDump is not opened.");
+ throw CABRTException(EXCEP_DD_OPEN, "DebugDump is not opened");
}
std::string fullPath = concat_path_file(m_sDebugDumpDir.c_str(), pName);
SaveBinaryFile(fullPath.c_str(), pData, strlen(pData));
@@ -381,7 +381,7 @@ void CDebugDump::SaveBinary(const char* pName, const char* pData, unsigned pSize
{
if (!m_bOpened)
{
- throw CABRTException(EXCEP_DD_OPEN, "CDebugDump::SaveBinary(): DebugDump is not opened.");
+ throw CABRTException(EXCEP_DD_OPEN, "DebugDump is not opened");
}
std::string fullPath = concat_path_file(m_sDebugDumpDir.c_str(), pName);
SaveBinaryFile(fullPath.c_str(), pData, pSize);
@@ -400,7 +400,7 @@ void CDebugDump::InitGetNextFile()
m_pGetNextFileDir = opendir(m_sDebugDumpDir.c_str());
if (m_pGetNextFileDir == NULL)
{
- throw CABRTException(EXCEP_DD_OPEN, "Can't open dir " + m_sDebugDumpDir);
+ throw CABRTException(EXCEP_DD_OPEN, "Can't open dir '%s'", m_sDebugDumpDir.c_str());
}
}
diff --git a/lib/Utils/Makefile.am b/lib/Utils/Makefile.am
index 297007a..9618751 100644
--- a/lib/Utils/Makefile.am
+++ b/lib/Utils/Makefile.am
@@ -17,7 +17,8 @@ libABRTUtils_la_SOURCES = \
popen_and_save_output.cpp \
stringops.cpp \
dirsize.cpp \
- DebugDump.h DebugDump.cpp
+ DebugDump.h DebugDump.cpp \
+ ABRTException.cpp
libABRTUtils_la_CPPFLAGS = \
-Wall -Werror \
-I$(srcdir)/../../inc \
diff --git a/lib/Utils/Reporter.h b/lib/Utils/Reporter.h
index f278899..0a06a7c 100644
--- a/lib/Utils/Reporter.h
+++ b/lib/Utils/Reporter.h
@@ -42,7 +42,7 @@ class CReporter : public CPlugin
*/
virtual std::string Report(const map_crash_report_t& pCrashReport,
const map_plugin_settings_t& pSettings,
- const std::string& pArgs) = 0;
+ const char *pArgs) = 0;
};
#endif /* REPORTER_H_ */
diff --git a/lib/Utils/abrt_dbus.h b/lib/Utils/abrt_dbus.h
index b31a015..bc9889a 100644
--- a/lib/Utils/abrt_dbus.h
+++ b/lib/Utils/abrt_dbus.h
@@ -194,17 +194,19 @@ static int load_vector(DBusMessageIter* iter, std::vector<E>& val)
int r;
//int cnt = 0;
- //type = dbus_message_iter_get_arg_type(&sub_iter);
- /* here "type" is the element's type, and it will be checked by load_val */
- // if (type != DBUS_TYPE_INVALID) - not needed?
- do {
- E elem;
+ /* When the vector has 0 elements, we see DBUS_TYPE_INVALID here */
+ type = dbus_message_iter_get_arg_type(&sub_iter);
+ if (type != DBUS_TYPE_INVALID)
+ {
+ do {
+ E elem;
//cnt++;
- r = load_val(&sub_iter, elem);
- if (r < 0)
- return r;
- val.push_back(elem);
- } while (r == ABRT_DBUS_MORE_FIELDS);
+ r = load_val(&sub_iter, elem);
+ if (r < 0)
+ return r;
+ val.push_back(elem);
+ } while (r == ABRT_DBUS_MORE_FIELDS);
+ }
//log("%s: %d elems", __func__, cnt);
return dbus_message_iter_next(iter);
diff --git a/lib/Utils/abrt_xmlrpc.cpp b/lib/Utils/abrt_xmlrpc.cpp
index 11c431b..7205316 100644
--- a/lib/Utils/abrt_xmlrpc.cpp
+++ b/lib/Utils/abrt_xmlrpc.cpp
@@ -13,7 +13,7 @@ void throw_if_xml_fault_occurred(xmlrpc_env *env)
xmlrpc_env_clean(env); // this is needed ONLY if fault_occurred
xmlrpc_env_init(env); // just in case user catches ex and _continues_ to use env
error_msg("%s", errmsg.c_str()); // show error in daemon log
- throw CABRTException(EXCEP_PLUGIN, errmsg);
+ throw CABRTException(EXCEP_PLUGIN, errmsg.c_str());
}
}
diff --git a/lib/Utils/logging.cpp b/lib/Utils/logging.cpp
index cae609b..53b83d7 100644
--- a/lib/Utils/logging.cpp
+++ b/lib/Utils/logging.cpp
@@ -60,6 +60,7 @@ static void verror_msg_helper(const char *s, va_list p, const char* strerr, int
fflush(stdout);
full_write(STDERR_FILENO, msg, used + msgeol_len);
}
+ msg[used] = '\0'; /* remove msg_eol (usually "\n") */
if (flags & LOGMODE_SYSLOG) {
syslog(LOG_ERR, "%s", msg + prefix_len);
}
@@ -118,16 +119,6 @@ void perror_msg(const char *s, ...)
va_end(p);
}
-void simple_perror_msg_and_die(const char *s)
-{
- perror_msg_and_die("%s", s);
-}
-
-void simple_perror_msg(const char *s)
-{
- perror_msg("%s", s);
-}
-
void die_out_of_memory(void)
{
error_msg_and_die("Out of memory, exiting");
diff --git a/lib/Utils/xfuncs.cpp b/lib/Utils/xfuncs.cpp
index b1941f7..0e57639 100644
--- a/lib/Utils/xfuncs.cpp
+++ b/lib/Utils/xfuncs.cpp
@@ -8,12 +8,12 @@
/* Turn on nonblocking I/O on a fd */
int ndelay_on(int fd)
{
- return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) | O_NONBLOCK);
+ return fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) | O_NONBLOCK);
}
int ndelay_off(int fd)
{
- return fcntl(fd, F_SETFL, fcntl(fd,F_GETFL) & ~O_NONBLOCK);
+ return fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_NONBLOCK);
}
int close_on_exec_on(int fd)