diff options
| author | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-01-19 14:52:53 +0100 |
|---|---|---|
| committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-01-19 14:52:53 +0100 |
| commit | 8ddcb9404d65bc6b09910099988fe6a0f33fe250 (patch) | |
| tree | 2214c48219c8f3cf1b4110113467fa92d38bfa84 | |
| parent | 04d69684f58d851ab604b2ed5eeb04f373efd4d8 (diff) | |
| parent | b348085ac9f3d4a7ded81026bffa962a065bdf97 (diff) | |
| download | abrt-8ddcb9404d65bc6b09910099988fe6a0f33fe250.tar.gz abrt-8ddcb9404d65bc6b09910099988fe6a0f33fe250.tar.xz abrt-8ddcb9404d65bc6b09910099988fe6a0f33fe250.zip | |
resolve conflict
| -rw-r--r-- | inc/CrashTypes.h | 11 | ||||
| -rw-r--r-- | lib/Plugins/Bugzilla.cpp | 2 | ||||
| -rw-r--r-- | lib/Plugins/Catcut.cpp | 6 | ||||
| -rw-r--r-- | lib/Plugins/Logger.conf | 4 | ||||
| -rw-r--r-- | lib/Plugins/Logger.cpp | 2 | ||||
| -rw-r--r-- | lib/Plugins/Mailx.cpp | 12 | ||||
| -rw-r--r-- | lib/Plugins/SQLite3.cpp | 4 | ||||
| -rw-r--r-- | lib/Plugins/TicketUploader.cpp | 5 | ||||
| -rw-r--r-- | lib/Utils/make_descr.cpp | 68 | ||||
| -rw-r--r-- | po/POTFILES.in | 1 | ||||
| -rw-r--r-- | src/Applet/Applet.cpp | 1 | ||||
| -rw-r--r-- | src/CLI/CLI.cpp | 2 | ||||
| -rw-r--r-- | src/Daemon/CommLayerServerDBus.cpp | 9 | ||||
| -rw-r--r-- | src/Daemon/Daemon.cpp | 1 | ||||
| -rw-r--r-- | src/Daemon/MiddleWare.cpp | 4 | ||||
| -rw-r--r-- | src/Gui/CCDump.py | 34 | ||||
| -rw-r--r-- | src/Gui/CCDumpList.py | 5 | ||||
| -rw-r--r-- | src/Gui/CCMainWindow.py | 1 | ||||
| -rw-r--r-- | src/Gui/CCReport.py | 30 | ||||
| -rw-r--r-- | src/Gui/CCReporterDialog.py | 4 | ||||
| -rw-r--r-- | src/Gui/CC_gui_functions.py | 2 | ||||
| -rw-r--r-- | src/Gui/Makefile.am | 2 |
22 files changed, 78 insertions, 132 deletions
diff --git a/inc/CrashTypes.h b/inc/CrashTypes.h index 77947f6..ccbdd92 100644 --- a/inc/CrashTypes.h +++ b/inc/CrashTypes.h @@ -4,17 +4,14 @@ #include "abrt_types.h" // SYS - system value, should not be displayed -// BIN - binary value, should be displayed as a path to binary file -// TXT - text value, should be displayed -// ATT - text value which can be sent as attachment via reporters -// TODO: maybe we don't need separate CD_ATT - can simply look at strlen(content) -// in all places which want to handle "long" and "short" texts differently +// BIN - binary data +// TXT - text data, can be displayed #define CD_SYS "s" #define CD_BIN "b" #define CD_TXT "t" -#define CD_ATT "a" -#define CD_ATT_SIZE (256) +/* Text bigger than this usually is attached, not added inline */ +#define CD_TEXT_ATT_SIZE (2*1024) #define CD_ISEDITABLE "y" #define CD_ISNOTEDITABLE "n" diff --git a/lib/Plugins/Bugzilla.cpp b/lib/Plugins/Bugzilla.cpp index 6f0f8d7..f963eb9 100644 --- a/lib/Plugins/Bugzilla.cpp +++ b/lib/Plugins/Bugzilla.cpp @@ -360,7 +360,7 @@ void ctx::add_attachments(const char* bug_id_str, const map_crash_report_t& pCra const std::string &type = it->second[CD_TYPE]; const std::string &content = it->second[CD_CONTENT]; - if (type == CD_ATT) + if (type == CD_TXT && content.length() > CD_TEXT_ATT_SIZE) { char *encoded64 = encode_base64(content.c_str(), content.length()); // fails only when you write query. when it's done it never fails. diff --git a/lib/Plugins/Catcut.cpp b/lib/Plugins/Catcut.cpp index 27b868d..b69038f 100644 --- a/lib/Plugins/Catcut.cpp +++ b/lib/Plugins/Catcut.cpp @@ -390,9 +390,9 @@ ctx::add_attachments(const char* xmlrpc_URL, map_crash_report_t::const_iterator it = pCrashReport.begin(); for (; it != pCrashReport.end(); it++) { - if (it->second[CD_TYPE] == CD_ATT) + if (it->second[CD_TYPE] == CD_TXT && it->second[CD_TYPE].size() > CD_TEXT_ATT_SIZE) { - update_client(_("Attaching (CD_ATT): %s"), it->first.c_str()); + update_client(_("Attaching (text): %s"), it->first.c_str()); string description = "File: " + it->first; string URL = request_upload(auth_cookie, @@ -410,7 +410,7 @@ ctx::add_attachments(const char* xmlrpc_URL, } else if (it->second[CD_TYPE] == CD_BIN) { - update_client(_("Attaching (CD_ATT): %s"), it->first.c_str()); + update_client(_("Attaching binary: %s"), it->first.c_str()); string description = "File: " + it->first; string URL = request_upload(auth_cookie, diff --git a/lib/Plugins/Logger.conf b/lib/Plugins/Logger.conf index 39ba47e..8809963 100644 --- a/lib/Plugins/Logger.conf +++ b/lib/Plugins/Logger.conf @@ -1,6 +1,6 @@ # Configuration for Logger plugin -LogPath = /var/log/abrt-logger +LogPath = /var/log/abrt.log AppendLogs = yes -Enabled = yes
\ No newline at end of file +Enabled = yes diff --git a/lib/Plugins/Logger.cpp b/lib/Plugins/Logger.cpp index a0dea42..d6cc124 100644 --- a/lib/Plugins/Logger.cpp +++ b/lib/Plugins/Logger.cpp @@ -28,7 +28,7 @@ #include "ABRTException.h" CLogger::CLogger() : - m_sLogPath("/var/log/abrt-logger"), + m_sLogPath("/var/log/abrt.log"), m_bAppendLogs(true) {} diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp index df33e84..2f8448f 100644 --- a/lib/Plugins/Mailx.cpp +++ b/lib/Plugins/Mailx.cpp @@ -74,7 +74,7 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport, args = append_str_to_vector(args, arg_size, MAILX_COMMAND); //TODO: move email body generation to make_descr.cpp - std::string binaryFiles, commonFiles, bigTextFiles, additionalFiles, UUIDFile; + std::string binaryFiles, commonFiles, additionalFiles, UUIDFile; map_crash_report_t::const_iterator it; for (it = pCrashReport.begin(); it != pCrashReport.end(); it++) { @@ -105,13 +105,6 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport, commonFiles += "\n\n"; } } - if (it->second[CD_TYPE] == CD_ATT) - { - bigTextFiles += it->first; - bigTextFiles += "\n-----\n"; - bigTextFiles += it->second[CD_CONTENT]; - bigTextFiles += "\n\n"; - } if (it->second[CD_TYPE] == CD_BIN) { binaryFiles += " -a "; @@ -133,9 +126,6 @@ std::string CMailx::Report(const map_crash_report_t& pCrashReport, emailBody += "\nAdditional information\n"; emailBody += "=====\n\n"; emailBody += additionalFiles; - emailBody += "\nOther information\n"; - emailBody += "=====\n\n"; - emailBody += bigTextFiles; emailBody += '\n'; args = append_str_to_vector(args, arg_size, "-s"); diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp index ffcf05f..7f90c46 100644 --- a/lib/Plugins/SQLite3.cpp +++ b/lib/Plugins/SQLite3.cpp @@ -21,11 +21,9 @@ #include <sqlite3.h> #include <string> -#include <stdlib.h> +#include "abrtlib.h" #include "SQLite3.h" #include "ABRTException.h" -#include <limits.h> -#include <abrtlib.h> using namespace std; diff --git a/lib/Plugins/TicketUploader.cpp b/lib/Plugins/TicketUploader.cpp index 608ee40..7483768 100644 --- a/lib/Plugins/TicketUploader.cpp +++ b/lib/Plugins/TicketUploader.cpp @@ -203,9 +203,8 @@ string CTicketUploader::Report(const map_crash_report_t& pCrashReport, map_crash_report_t::const_iterator it; for (it = pCrashReport.begin(); it != pCrashReport.end(); it++) { - if (it->second[CD_TYPE] == CD_TXT - || it->second[CD_TYPE] == CD_ATT - ) { + if (it->second[CD_TYPE] == CD_TXT) + { string ofile_name = concat_path_file(tmptar_name.c_str(), it->first.c_str()); ofstream ofile(ofile_name.c_str(), fstream::trunc|fstream::binary); if (!ofile) diff --git a/lib/Utils/make_descr.cpp b/lib/Utils/make_descr.cpp index 90bd76a..2a0d4a9 100644 --- a/lib/Utils/make_descr.cpp +++ b/lib/Utils/make_descr.cpp @@ -50,9 +50,6 @@ static void add_content(bool &was_multiline, string& description, const char *he } } -/* Text attachments smaller than this will be also included in descrition */ -#define INLINE_TEXT_ATT_SIZE (2*1024) - string make_description_bz(const map_crash_report_t& pCrashReport) { string description; @@ -79,22 +76,21 @@ string make_description_bz(const map_crash_report_t& pCrashReport) const string &filename = it->first; const string &type = it->second[CD_TYPE]; const string &content = it->second[CD_CONTENT]; - if (type == CD_TXT - || (type == CD_ATT && content.size() < INLINE_TEXT_ATT_SIZE) - ) { - if (filename != CD_UUID - && filename != FILENAME_ARCHITECTURE - && filename != FILENAME_RELEASE - && filename != CD_REPRODUCE - && filename != CD_COMMENT - ) { - add_content(was_multiline, description, filename.c_str(), content.c_str()); - } - continue; - } - if (type == CD_ATT) + if (type == CD_TXT) { - add_content(was_multiline, description, "Attached file", filename.c_str()); + if (content.size() <= CD_TEXT_ATT_SIZE) + { + if (filename != CD_UUID + && filename != FILENAME_ARCHITECTURE + && filename != FILENAME_RELEASE + && filename != CD_REPRODUCE + && filename != CD_COMMENT + ) { + add_content(was_multiline, description, filename.c_str(), content.c_str()); + } + } else { + add_content(was_multiline, description, "Attached file", filename.c_str()); + } } } @@ -113,7 +109,6 @@ string make_description_logger(const map_crash_report_t& pCrashReport) const string &type = it->second[CD_TYPE]; const string &content = it->second[CD_CONTENT]; if (type == CD_TXT - || type == CD_ATT || type == CD_BIN ) { if (content == "1.\n2.\n3.\n") @@ -181,26 +176,27 @@ string make_description_catcut(const map_crash_report_t& pCrashReport) const string &content = it->second[CD_CONTENT]; if (type == CD_TXT) { - if (filename != CD_UUID - && filename != FILENAME_ARCHITECTURE - && filename != FILENAME_RELEASE - && filename != CD_REPRODUCE - && filename != CD_COMMENT - ) { - pDescription += '\n'; + if (content.length() <= CD_TEXT_ATT_SIZE) + { + if (filename != CD_UUID + && filename != FILENAME_ARCHITECTURE + && filename != FILENAME_RELEASE + && filename != CD_REPRODUCE + && filename != CD_COMMENT + ) { + pDescription += '\n'; + pDescription += filename; + pDescription += "\n-----\n"; + pDescription += content; + pDescription += "\n\n"; + } + } else { + pDescription += "\n\nAttached files\n" + "----\n"; pDescription += filename; - pDescription += "\n-----\n"; - pDescription += content; - pDescription += "\n\n"; + pDescription += '\n'; } } - else if (type == CD_ATT) - { - pDescription += "\n\nAttached files\n" - "----\n"; - pDescription += filename; - pDescription += '\n'; - } else if (type == CD_BIN) { error_msg(_("Binary file %s will not be reported"), filename.c_str()); diff --git a/po/POTFILES.in b/po/POTFILES.in index 6f5c266..0d21868 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -11,7 +11,6 @@ src/Gui/CC_gui_functions.py src/Gui/ccgui.glade src/Gui/CCMainWindow.py src/Gui/CCReporterDialog.py -src/Gui/CCReport.py src/Gui/CellRenderers.py src/Gui/dialogs.glade src/Gui/PluginList.py diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index eea3ef7..550e1aa 100644 --- a/src/Applet/Applet.cpp +++ b/src/Applet/Applet.cpp @@ -20,7 +20,6 @@ #include <dbus/dbus-shared.h> #include <dbus/dbus-glib.h> #include <dbus/dbus-glib-lowlevel.h> -#include <limits.h> #if HAVE_CONFIG_H #include <config.h> #endif diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index 1ea3a5d..bc8ddf6 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -53,7 +53,7 @@ static void print_crash_infos(vector_crash_infos_t& pCrashInfos, int pMode) for (ii = 0; ii < pCrashInfos.size(); ii++) { map_crash_info_t& info = pCrashInfos[ii]; - if (pMode == OPT_GET_LIST_FULL || info.find(CD_REPORTED)->second[CD_CONTENT] != "1") + if (pMode == OPT_GET_LIST_FULL || info[CD_REPORTED][CD_CONTENT] != "1") { const char *timestr = info[CD_TIME][CD_CONTENT].c_str(); long time = strtol(timestr, NULL, 10); diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index db0d2f5..182aa6c 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -205,10 +205,8 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply) int r; DBusMessageIter in_iter; dbus_message_iter_init(call, &in_iter); - map_crash_report_t argin1; - const char* comment; - const char* reproduce; + map_crash_report_t argin1; r = load_val(&in_iter, argin1); if (r == ABRT_DBUS_ERROR) { @@ -218,9 +216,8 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply) map_crash_report_t::const_iterator it_comment = argin1.find(CD_COMMENT); map_crash_report_t::const_iterator it_reproduce = argin1.find(CD_REPRODUCE); - comment = (it_comment != argin1.end()) ? it_comment->second[CD_CONTENT].c_str() : ""; - reproduce = (it_reproduce != argin1.end()) ? it_reproduce->second[CD_CONTENT].c_str() : ""; - + const char* comment = (it_comment != argin1.end()) ? it_comment->second[CD_CONTENT].c_str() : ""; + const char* reproduce = (it_reproduce != argin1.end()) ? it_reproduce->second[CD_CONTENT].c_str() : ""; const char* errmsg = NULL; if (strlen(comment) > LIMIT_MESSAGE) { diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index a2970af..dc547af 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -21,7 +21,6 @@ #include <pthread.h> #include <resolv.h> /* res_init */ #include <string> -#include <limits.h> #include <sys/inotify.h> #include <xmlrpc-c/base.h> #include <xmlrpc-c/client.h> diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 70527eb..c2a122a 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -187,7 +187,7 @@ static void DebugDumpToCrashReport(const char *pDebugDumpDir, map_crash_report_t add_crash_data_to_crash_report( pCrashReport, short_name, - (content.length() < CD_ATT_SIZE ? CD_TXT : CD_ATT), + CD_TXT, CD_ISEDITABLE, content ); @@ -433,6 +433,8 @@ report_status_t Report(const map_crash_report_t& pCrashReport, { report_status_t ret; + /* dbus handler passes pCrashReport from user without checking it */ + if (!CheckReport(pCrashReport)) { throw CABRTException(EXCEP_ERROR, "Report(): Some of mandatory report data are missing."); diff --git a/src/Gui/CCDump.py b/src/Gui/CCDump.py index 212d441..96d036c 100644 --- a/src/Gui/CCDump.py +++ b/src/Gui/CCDump.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- from datetime import datetime -TYPE = 0 -EDITABLE = 1 -CONTENT = 2 +from abrt_utils import _, init_logging, log, log1, log2 + +CD_TYPE = 0 +CD_EDITABLE = 1 +CD_CONTENT = 2 class Dump(): """Class for mapping the debug dump to python object""" @@ -19,40 +21,40 @@ class Dump(): self.Reported = None def getUUID(self): - return self.UUID[CONTENT] + return self.UUID[CD_CONTENT] def getUID(self): - return self.UID[CONTENT] + return self.UID[CD_CONTENT] def getCount(self): - return self.Count[CONTENT] + return self.Count[CD_CONTENT] def getExecutable(self): - return self.Executable[CONTENT] + return self.Executable[CD_CONTENT] def getPackage(self): - return self.Package[CONTENT] + return self.Package[CD_CONTENT] def isReported(self): - return self.Reported[CONTENT] == "1" + return self.Reported[CD_CONTENT] == "1" def getMessage(self): if not self.Message: - return [] - #return self.Message[CONTENT].split('\n') - return self.Message[CONTENT] + return "" #[] + #return self.Message[CD_CONTENT].split('\n') + return self.Message[CD_CONTENT] def getTime(self,format): #print format if format: try: - return datetime.fromtimestamp(int(self.Time[CONTENT])).strftime(format) + return datetime.fromtimestamp(int(self.Time[CD_CONTENT])).strftime(format) except Exception, e: print e - return int(self.Time[CONTENT]) + return int(self.Time[CD_CONTENT]) def getPackageName(self): - return self.Package[CONTENT][:self.Package[CONTENT].find("-")] + return self.Package[CD_CONTENT][:self.Package[CD_CONTENT].find("-")] def getDescription(self): - return self.Description[CONTENT] + return self.Description[CD_CONTENT] diff --git a/src/Gui/CCDumpList.py b/src/Gui/CCDumpList.py index a8657e0..9888b10 100644 --- a/src/Gui/CCDumpList.py +++ b/src/Gui/CCDumpList.py @@ -2,6 +2,8 @@ import CCDBusBackend from CCDump import Dump +from abrt_utils import _, init_logging, log, log1, log2 + class DumpList(list): """Class to store list of debug dumps""" def __init__(self,dbus_manager=None): @@ -16,8 +18,7 @@ class DumpList(list): for row in rows: entry = Dump() for column in row: - #if column == "Reported": - # print "DumpList adding %s:%s" % (column,row[column]) + log2(" DumpList.%s='%s'", column, row[column]) entry.__dict__[column] = row[column] self.append(entry) except Exception, e: diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index 70f780a..a8101d4 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -28,7 +28,6 @@ from CCDumpList import getDumpList, DumpList from CCReporterDialog import ReporterDialog from PluginsSettingsDialog import PluginsSettingsDialog from SettingsDialog import SettingsDialog -from CCReport import Report from PluginList import getPluginInfoList import ABRTExceptions diff --git a/src/Gui/CCReport.py b/src/Gui/CCReport.py deleted file mode 100644 index 90c8a3b..0000000 --- a/src/Gui/CCReport.py +++ /dev/null @@ -1,30 +0,0 @@ -# -*- coding: utf-8 -*- - -class Report(): - """Class for mapping the report to pyhon object""" - def __init__(self, report): - self.UUID = None - self.Architecture = None - self.Kernel = None - self.Release = None - self.Executable = None - self.CmdLine = None - self.Package = None - self.TextData1 = None - self.TextData2 = None - self.BinaryData1 = None - self.BinaryData2 = None - for item in report: - self.__dict__[item] = report[item] - - def getUUID(self): - return self.UUID - - def getArchitecture(self): - return self.Architecture - - def getExecutable(self): - return self.Executable - - def getPackage(self): - return self.Package diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index 47cf908..2cba607 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -6,7 +6,6 @@ import gtk.glade import pango import sys from CC_gui_functions import * -from CCReport import Report import CellRenderers from ABRTPlugin import PluginInfo from PluginSettingsUI import PluginSettingsUI @@ -22,7 +21,6 @@ CD_CONTENT = 2 CD_SYS = "s" CD_BIN = "b" CD_TXT = "t" -CD_ATT = "a" # response REFRESH = -50 @@ -245,7 +243,7 @@ class ReporterDialog(): if self.report[item][CD_TYPE] != CD_SYS: # item name 0| value 1| editable? 2| toggled? 3| visible?(attachment)4 # FIXME: handle editable fields - if self.report[item][CD_TYPE] in [CD_ATT,CD_BIN]: + if self.report[item][CD_TYPE] == CD_BIN: self.builder.get_object("fAttachment").show() vbAttachments = self.builder.get_object("vbAttachments") toggle = gtk.CheckButton(self.report[item][CD_CONTENT]) diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index 0379f20..a9c47fa 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -234,5 +234,5 @@ def show_log(log, parent=None): if __name__ == "__main__": window = gtk.Window() - gui_report_dialog("<b>Bugzilla</b>: <span foreground='red'>CReporterBugzilla::Report(): CReporterBugzilla::Login(): RPC response indicates failure. The username or password you entered is not valid.</span>\n<b>Logger</b>: Report was stored into: /var/log/abrt-logger", window) + gui_report_dialog("<b>Bugzilla</b>: <span foreground='red'>CReporterBugzilla::Report(): CReporterBugzilla::Login(): RPC response indicates failure. The username or password you entered is not valid.</span>\n<b>Logger</b>: Report was stored into: /var/log/abrt.log", window) gtk.main() diff --git a/src/Gui/Makefile.am b/src/Gui/Makefile.am index 60a7bfe..3cac1ee 100644 --- a/src/Gui/Makefile.am +++ b/src/Gui/Makefile.am @@ -3,7 +3,7 @@ bin_SCRIPTS = abrt-gui PYTHON_FILES = CCDBusBackend.py CCDumpList.py CCDump.py CC_gui_functions.py \ - CCReporterDialog.py CCReport.py abrt_utils.py \ + CCReporterDialog.py abrt_utils.py \ CCMainWindow.py CellRenderers.py ABRTExceptions.py \ SettingsDialog.py ABRTPlugin.py PluginList.py PluginSettingsUI.py \ PluginsSettingsDialog.py ConfBackend.py |
