From b73a86c04c9469d2e8bae7225575d1e785d0852f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 4 Dec 2009 17:19:18 +0100 Subject: small fix on top of DeleteDebugDump change Signed-off-by: Denys Vlasenko --- src/CLI/dbus.cpp | 2 -- src/Daemon/CrashWatcher.cpp | 4 +++- src/Daemon/Daemon.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/CLI/dbus.cpp b/src/CLI/dbus.cpp index 67c489e0..2da9d745 100644 --- a/src/CLI/dbus.cpp +++ b/src/CLI/dbus.cpp @@ -160,8 +160,6 @@ void call_DeleteDebugDump(const char* uuid) DBUS_TYPE_INVALID); DBusMessage *reply = send_get_reply_and_unref(msg); - //it returns a single boolean value, - //but we don't use it (yet?) dbus_message_unref(reply); } diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 1606f86d..2973cfcc 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -201,7 +201,9 @@ void DeleteDebugDump(const char *pUUID, const char *pUID) database->DeleteRow(pUUID, pUID); database->DisConnect(); - delete_debug_dump_dir(row.m_sDebugDumpDir.c_str()); + const char *dump_dir = row.m_sDebugDumpDir.c_str(); + if (dump_dir[0] != '\0') + delete_debug_dump_dir(dump_dir); } catch (CABRTException& e) { diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index f9910dce..1fa324fc 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -64,7 +64,7 @@ * "Please report this crash": calls Report() of all registered reporter plugins. * Returns report_status_t (map_vector_string_t) - the status of each call. * 2nd parameter is the contents of user's abrt.conf. - * - DeleteDebugDump(UUID): delete corresponding /var/cache/abrt/DIR. Returns bool + * - DeleteDebugDump(UUID): delete it from DB and delete corresponding /var/cache/abrt/DIR * - GetPluginsInfo(): returns vector_map_string_t * - GetPluginSettings(PluginName): returns map_plugin_settings_t (map_string_t) * - SetPluginSettings(PluginName, map_plugin_settings_t): returns void -- cgit From 58ca9815ee692a7020a4a25dacfda2de075228ad Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 4 Dec 2009 18:24:28 +0100 Subject: do not send "MISSING:" over dbus; clarify a message in debuginfo installer Signed-off-by: Denys Vlasenko --- src/Daemon/abrt-debuginfo-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Daemon/abrt-debuginfo-install b/src/Daemon/abrt-debuginfo-install index 23379b46..6278b63c 100755 --- a/src/Daemon/abrt-debuginfo-install +++ b/src/Daemon/abrt-debuginfo-install @@ -148,7 +148,7 @@ print_package_names() { yumopts="-C" echo "`count_words $missing_debuginfo_files` missing debuginfos, getting package list from cache" >&2 else - echo "`count_words $missing_debuginfo_files` missing debuginfos, getting package list" >&2 + echo "`count_words $missing_debuginfo_files` missing debuginfos, getting package list from repositories" >&2 fi local cmd="yum $yumopts --enablerepo=*debuginfo* --quiet provides $missing_debuginfo_files" echo "$cmd" >"yum_provides.$1.OUT" -- cgit From 4ceb3715a3a6b752009627b0dc6a1974664c03a1 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Sun, 6 Dec 2009 22:23:11 +0100 Subject: remove std::string usage from class CABRTException. Signed-off-by: Denys Vlasenko --- src/Daemon/CommLayerServerSocket.cpp | 2 +- src/Daemon/PluginManager.cpp | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp index ee775c6d..80dabb71 100644 --- a/src/Daemon/CommLayerServerSocket.cpp +++ b/src/Daemon/CommLayerServerSocket.cpp @@ -40,7 +40,7 @@ std::string CCommLayerServerSocket::GetSenderUID(int pSenderSocket) socklen_t len = sizeof(creds); if (getsockopt(pSenderSocket, SOL_SOCKET, SO_PEERCRED, &creds, &len) == -1) { - throw CABRTException(EXCEP_ERROR, "CCommLayerServerSocket::GetSenderUID(): Error can get sender uid."); + throw CABRTException(EXCEP_ERROR, "CCommLayerServerSocket::GetSenderUID(): error getting sender uid"); } return to_string(creds.uid); } diff --git a/src/Daemon/PluginManager.cpp b/src/Daemon/PluginManager.cpp index 58151b29..82f22e85 100644 --- a/src/Daemon/PluginManager.cpp +++ b/src/Daemon/PluginManager.cpp @@ -286,11 +286,11 @@ CAnalyzer* CPluginManager::GetAnalyzer(const char *pName) map_plugins_t::iterator plugin = m_mapPlugins.find(pName); if (plugin == m_mapPlugins.end()) { - throw CABRTException(EXCEP_PLUGIN, ssprintf("Plugin '%s' is not registered", pName)); + throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not registered", pName); } if (m_mapABRTPlugins[pName]->GetType() != ANALYZER) { - throw CABRTException(EXCEP_PLUGIN, ssprintf("Plugin '%s' is not an analyzer plugin", pName)); + throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not an analyzer plugin", pName); } return (CAnalyzer*)(plugin->second); } @@ -300,11 +300,11 @@ CReporter* CPluginManager::GetReporter(const char *pName) map_plugins_t::iterator plugin = m_mapPlugins.find(pName); if (plugin == m_mapPlugins.end()) { - throw CABRTException(EXCEP_PLUGIN, ssprintf("Plugin '%s' is not registered", pName)); + throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not registered", pName); } if (m_mapABRTPlugins[pName]->GetType() != REPORTER) { - throw CABRTException(EXCEP_PLUGIN, ssprintf("Plugin '%s' is not a reporter plugin", pName)); + throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not a reporter plugin", pName); } return (CReporter*)(plugin->second); } @@ -314,11 +314,11 @@ CAction* CPluginManager::GetAction(const char *pName) map_plugins_t::iterator plugin = m_mapPlugins.find(pName); if (plugin == m_mapPlugins.end()) { - throw CABRTException(EXCEP_PLUGIN, ssprintf("Plugin '%s' is not registered", pName)); + throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not registered", pName); } if (m_mapABRTPlugins[pName]->GetType() != ACTION) { - throw CABRTException(EXCEP_PLUGIN, ssprintf("Plugin '%s' is not an action plugin", pName)); + throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not an action plugin", pName); } return (CAction*)(plugin->second); } @@ -328,11 +328,11 @@ CDatabase* CPluginManager::GetDatabase(const char *pName) map_plugins_t::iterator plugin = m_mapPlugins.find(pName); if (plugin == m_mapPlugins.end()) { - throw CABRTException(EXCEP_PLUGIN, ssprintf("Plugin '%s' is not registered", pName)); + throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not registered", pName); } if (m_mapABRTPlugins[pName]->GetType() != DATABASE) { - throw CABRTException(EXCEP_PLUGIN, ssprintf("Plugin '%s' is not a database plugin", pName)); + throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not a database plugin", pName); } return (CDatabase*)(plugin->second); } @@ -342,7 +342,7 @@ plugin_type_t CPluginManager::GetPluginType(const char *pName) map_plugins_t::iterator plugin = m_mapPlugins.find(pName); if (plugin == m_mapPlugins.end()) { - throw CABRTException(EXCEP_PLUGIN, ssprintf("Plugin '%s' is not registered", pName)); + throw CABRTException(EXCEP_PLUGIN, "Plugin '%s' is not registered", pName); } return m_mapABRTPlugins[pName]->GetType(); } -- cgit From fb72ac689ca4832fca215edc942ae01592ecfff8 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 7 Dec 2009 11:46:13 +0100 Subject: *: remove most of remaining const string& params Signed-off-by: Denys Vlasenko --- src/Applet/CCApplet.cpp | 2 +- src/Applet/CCApplet.h | 2 +- src/CLI/ABRTSocket.h | 8 ++++---- src/Daemon/CommLayerServer.h | 4 ++-- src/Daemon/CommLayerServerDBus.cpp | 10 ++++------ src/Daemon/CommLayerServerDBus.h | 4 ++-- src/Daemon/CommLayerServerSocket.h | 8 ++++---- src/Daemon/CrashWatcher.cpp | 2 ++ src/Daemon/Makefile.am | 3 ++- src/Daemon/MiddleWare.cpp | 6 +++--- 10 files changed, 25 insertions(+), 24 deletions(-) (limited to 'src') diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp index c91b4e82..b73b41d0 100644 --- a/src/Applet/CCApplet.cpp +++ b/src/Applet/CCApplet.cpp @@ -349,7 +349,7 @@ bool CApplet::load_icons() } -//int CApplet::AddEvent(int pUUID, const std::string& pProgname) +//int CApplet::AddEvent(int pUUID, const char *pProgname) //{ // m_mapEvents[pUUID] = "pProgname"; // SetIconTooltip(_("Pending events: %i"), m_mapEvents.size()); diff --git a/src/Applet/CCApplet.h b/src/Applet/CCApplet.h index c5396a72..6c47c0a1 100644 --- a/src/Applet/CCApplet.h +++ b/src/Applet/CCApplet.h @@ -71,7 +71,7 @@ class CApplet // or ask the daemon every time? // maybe just events which occured during current session // map:: -// int AddEvent(int pUUID, const std::string& pProgname); +// int AddEvent(int pUUID, const char *pProgname); // int RemoveEvent(int pUUID); protected: diff --git a/src/CLI/ABRTSocket.h b/src/CLI/ABRTSocket.h index 5d5383fa..536e4b50 100644 --- a/src/CLI/ABRTSocket.h +++ b/src/CLI/ABRTSocket.h @@ -10,20 +10,20 @@ class CABRTSocket private: int m_nSocket; - void Send(const std::string& pMessage); + void Send(const char *pMessage); void Recv(std::string& pMessage); public: CABRTSocket(); ~CABRTSocket(); - void Connect(const std::string& pPath); + void Connect(const char *pPath); void Disconnect(); vector_crash_infos_t GetCrashInfos(); - map_crash_report_t CreateReport(const std::string& pUUID); + map_crash_report_t CreateReport(const char *pUUID); void Report(const map_crash_report_t& pReport); - void DeleteDebugDump(const std::string& pUUID); + void DeleteDebugDump(const char *pUUID); }; #endif /* ABRTSOCKET_H_ */ diff --git a/src/Daemon/CommLayerServer.h b/src/Daemon/CommLayerServer.h index 21c1b304..367c0956 100644 --- a/src/Daemon/CommLayerServer.h +++ b/src/Daemon/CommLayerServer.h @@ -17,8 +17,8 @@ class CCommLayerServer { virtual void JobDone(const char* pDest, const char* pUUID) = 0; virtual void QuotaExceed(const char* str) {} - virtual void Update(const std::string& pMessage, const char* peer, uint64_t pJobID) {}; - virtual void Warning(const std::string& pMessage, const char* peer, uint64_t pJobID) {}; + virtual void Update(const char* pMessage, const char* peer, uint64_t pJobID) {}; + virtual void Warning(const char* pMessage, const char* peer, uint64_t pJobID) {}; }; #endif diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 27a18c24..646974dd 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -88,23 +88,21 @@ void CCommLayerServerDBus::JobDone(const char* peer, const char* pUUID) send_flush_and_unref(msg); } -void CCommLayerServerDBus::Update(const std::string& pMessage, const char* peer, uint64_t job_id) +void CCommLayerServerDBus::Update(const char* pMessage, const char* peer, uint64_t job_id) { DBusMessage* msg = new_signal_msg("Update", peer); - const char* c_message = pMessage.c_str(); dbus_message_append_args(msg, - DBUS_TYPE_STRING, &c_message, + DBUS_TYPE_STRING, &pMessage, DBUS_TYPE_UINT64, &job_id, /* TODO: redundant parameter, remove from API */ DBUS_TYPE_INVALID); send_flush_and_unref(msg); } -void CCommLayerServerDBus::Warning(const std::string& pMessage, const char* peer, uint64_t job_id) +void CCommLayerServerDBus::Warning(const char* pMessage, const char* peer, uint64_t job_id) { DBusMessage* msg = new_signal_msg("Warning", peer); - const char* c_message = pMessage.c_str(); dbus_message_append_args(msg, - DBUS_TYPE_STRING, &c_message, + DBUS_TYPE_STRING, &pMessage, DBUS_TYPE_UINT64, &job_id, /* TODO: redundant parameter, remove from API */ DBUS_TYPE_INVALID); send_flush_and_unref(msg); diff --git a/src/Daemon/CommLayerServerDBus.h b/src/Daemon/CommLayerServerDBus.h index f159c732..9bd77666 100644 --- a/src/Daemon/CommLayerServerDBus.h +++ b/src/Daemon/CommLayerServerDBus.h @@ -15,8 +15,8 @@ class CCommLayerServerDBus virtual void JobDone(const char* pDest, const char* pUUID); virtual void QuotaExceed(const char* str); - virtual void Update(const std::string& pMessage, const char* peer, uint64_t pJobID); - virtual void Warning(const std::string& pMessage, const char* peer, uint64_t pJobID); + virtual void Update(const char* pMessage, const char* peer, uint64_t pJobID); + virtual void Warning(const char* pMessage, const char* peer, uint64_t pJobID); }; #endif diff --git a/src/Daemon/CommLayerServerSocket.h b/src/Daemon/CommLayerServerSocket.h index d1f464cc..753b67af 100644 --- a/src/Daemon/CommLayerServerSocket.h +++ b/src/Daemon/CommLayerServerSocket.h @@ -26,9 +26,9 @@ class CCommLayerServerSocket : public CCommLayerServer CCommLayerServerSocket(); virtual ~CCommLayerServerSocket(); - virtual vector_crash_infos_t GetCrashInfos(const std::string& pSender); - virtual report_status_t Report(const map_crash_report_t& pReport, const std::string& pSender); - virtual void DeleteDebugDump(const std::string& pUUID, const std::string& pSender); + virtual vector_crash_infos_t GetCrashInfos(const char *pSender); + virtual report_status_t Report(const map_crash_report_t& pReport, const char *pSender); + virtual void DeleteDebugDump(const char *pUUID, const char *pSender); - virtual void Crash(const std::string& arg1); + virtual void Crash(const char *arg1); }; diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 2973cfcc..3684d600 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -73,6 +73,8 @@ vector_crash_infos_t GetCrashInfos(const char *pUID) /* Deletes both DB record and dump dir */ DeleteDebugDump(uuid, uid); break; + default: + break; } } } diff --git a/src/Daemon/Makefile.am b/src/Daemon/Makefile.am index fc4f5e20..18fcd816 100644 --- a/src/Daemon/Makefile.am +++ b/src/Daemon/Makefile.am @@ -26,7 +26,8 @@ abrtd_CPPFLAGS = \ $(DBUS_CFLAGS) \ $(XMLRPC_CFLAGS) $(XMLRPC_CLIENT_CFLAGS) \ $(ENABLE_SOCKET_OR_DBUS) \ - -D_GNU_SOURCE + -D_GNU_SOURCE \ + -Wall abrtd_LDADD = \ ../../lib/Utils/libABRTUtils.la \ ../../lib/Utils/libABRTdUtils.la \ diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 8528f644..e7757648 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -348,7 +348,7 @@ void RunActionsAndReporters(const char *pDebugDumpDir) map_crash_report_t crashReport; DebugDumpToCrashReport(pDebugDumpDir, crashReport); VERB2 log("%s.Report(...)", it_ar->first.c_str()); - reporter->Report(crashReport, plugin_settings, it_ar->second); + reporter->Report(crashReport, plugin_settings, it_ar->second.c_str()); } else if (tp == ACTION) { @@ -490,7 +490,7 @@ report_status_t Report(const map_crash_report_t& pCrashReport, } #endif map_plugin_settings_t plugin_settings = pSettings[pluginName]; - std::string res = reporter->Report(pCrashReport, plugin_settings, it_r->second); + std::string res = reporter->Report(pCrashReport, plugin_settings, it_r->second.c_str()); #if 0 /* Using ~user/.abrt/ is bad wrt security */ if (home != "") @@ -688,7 +688,7 @@ void autoreport(const pair_string_string_t& reporter_options, const map_crash_re } map_plugin_settings_t plugin_settings; - std::string res = reporter->Report(crash_report, plugin_settings, reporter_options.second); + std::string res = reporter->Report(crash_report, plugin_settings, reporter_options.second.c_str()); } /** -- cgit From c7341fd8519a89af558b341f316931d851a747fc Mon Sep 17 00:00:00 2001 From: Karel Klic Date: Mon, 7 Dec 2009 12:27:31 +0100 Subject: Fixed fprintf format warning --- src/Backtrace/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Backtrace/main.c b/src/Backtrace/main.c index 9be93ca5..8add8c42 100644 --- a/src/Backtrace/main.c +++ b/src/Backtrace/main.c @@ -148,7 +148,7 @@ int main(int argc, char **argv) if (size > FILE_SIZE_LIMIT) { - fprintf(stderr, "Input file too big (%zd). Maximum size is %zd.\n", + fprintf(stderr, "Input file too big (%zd). Maximum size is %d.\n", size, FILE_SIZE_LIMIT); exit(EX_IOERR); } -- cgit From ea158979a5fb16c7e38488d8f3973ce7cef82e0d Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Mon, 7 Dec 2009 13:03:02 +0100 Subject: GUI: more fixes by rrakus@redhat.com --- src/Gui/ccgui.glade | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index 04bc26b5..022f4ab0 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -246,12 +246,19 @@ Zdenek Prikryl <zprikryl@redhat.com> queue none - + True - 0 - 0 - Not Reported - True + 6 + 6 + + + True + 0 + 0 + Not Reported + True + + -- cgit From 028affb1067dbdc8b7408ba85a7a242d6c2c42e9 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Mon, 7 Dec 2009 14:52:33 +0100 Subject: gui: removing unused self.update_pBar Signed-off-by: Denys Vlasenko --- src/Gui/CCMainWindow.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index 7de389bd..ee63a406 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -44,21 +44,18 @@ class MainWindow(): #Get the Main Window, and connect the "destroy" event self.window = self.wTree.get_widget("main_window3") - self.window.set_default_size(700, 480) if (self.window): + self.window.set_default_size(700, 480) self.window.connect("delete_event", self.delete_event_cb) self.window.connect("destroy", self.destroy) self.window.connect("focus-in-event", self.focus_in_cb) - self.statusWindow = self.wTree.get_widget("pBarWindow") - if self.statusWindow: - self.statusWindow.connect("delete_event", self.sw_delete_event_cb) - - self.appBar = self.wTree.get_widget("appBar") # pregress bar window to show while bt is being extracted self.pBarWindow = self.wTree.get_widget("pBarWindow") - self.pBarWindow.set_transient_for(self.window) - self.pBar = self.wTree.get_widget("pBar") + if self.pBarWindow: + self.pBarWindow.connect("delete_event", self.sw_delete_event_cb) + self.pBarWindow.set_transient_for(self.window) + self.pBar = self.wTree.get_widget("pBar") #init the dumps treeview self.dlist = self.wTree.get_widget("tvDumps") @@ -187,7 +184,7 @@ class MainWindow(): try: dumplist = getDumpList(self.ccdaemon, refresh=True) except Exception, e: - # there is something wrong with the daemon if we can get the dumplist + # there is something wrong with the daemon if we cant get the dumplist gui_error_message(_("Error while loading the dumplist.\n%s" % e)) # so we shouldn't continue.. sys.exit() @@ -290,7 +287,6 @@ class MainWindow(): if response == gtk.RESPONSE_APPLY: try: - self.update_pBar = False self.pBarWindow.show_all() self.timer = gobject.timeout_add(100, self.progress_update_cb) reporters_settings = {} @@ -308,9 +304,8 @@ class MainWindow(): self.refresh_report(report) def refresh_report(self, report): - self.update_pBar = False self.pBarWindow.show_all() - self.timer = gobject.timeout_add (100,self.progress_update_cb) + self.timer = gobject.timeout_add(100, self.progress_update_cb) # show the report window with selected report try: @@ -333,10 +328,9 @@ class MainWindow(): dumpsListStore, path = treeview.get_selection().get_selected_rows() if not path: return - self.update_pBar = False #self.pBar.show() self.pBarWindow.show_all() - self.timer = gobject.timeout_add (100,self.progress_update_cb) + self.timer = gobject.timeout_add(100, self.progress_update_cb) dump = dumpsListStore.get_value(dumpsListStore.get_iter(path[0]), dumpsListStore.get_n_columns()-1) # show the report window with selected dump -- cgit From 99edae18f6aa282f24c025835308053d01e7ffc5 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Mon, 7 Dec 2009 16:11:32 +0100 Subject: PyHook: use repr() for displaying variables rhbz#545070 --- src/Hooks/abrt_exception_handler.py.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in index c7f72530..6933ac00 100644 --- a/src/Hooks/abrt_exception_handler.py.in +++ b/src/Hooks/abrt_exception_handler.py.in @@ -129,7 +129,7 @@ def __dump_exception(out, text, tracebk): out.write ("\nLocal variables in innermost frame:\n") try: for (key, value) in frame.f_locals.items(): - out.write ("%s: %s\n" % (key, value)) + out.write ("%s: %s\n" % (key, repr(value))) except: pass -- cgit From 6a110acc7f2c0413ba856619b4257f66268ec956 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Mon, 7 Dec 2009 17:32:19 +0100 Subject: re-enabled gpg sign checking --- src/Daemon/abrt.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Daemon/abrt.conf b/src/Daemon/abrt.conf index 028f582d..ee034a6c 100644 --- a/src/Daemon/abrt.conf +++ b/src/Daemon/abrt.conf @@ -4,7 +4,7 @@ [ Common ] # With this option set to "yes", # only crashes in signed packages will be analyzed. -OpenGPGCheck = no +OpenGPGCheck = yes # GPG keys OpenGPGPublicKeys = /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora # Blacklisted packages -- cgit From 4fd4c946bd991b0414b0a037b3940369485ced1f Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Mon, 7 Dec 2009 17:55:02 +0100 Subject: PyHook: better logic for checking if abrtd is running rhbz#539987 --- src/Hooks/Makefile.am | 5 --- src/Hooks/abrt_exception_handler.py.in | 4 --- src/Hooks/sitecustomize.py | 65 ++++++++++++++++++---------------- 3 files changed, 34 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/Hooks/Makefile.am b/src/Hooks/Makefile.am index 21569570..af51d99a 100644 --- a/src/Hooks/Makefile.am +++ b/src/Hooks/Makefile.am @@ -45,14 +45,9 @@ abrt_pyhook_helper_CPPFLAGS = \ abrt_pyhook_helper_LDADD = \ ../../lib/Utils/libABRTUtils.la -man_MANS = pyhook.conf.5 - python_PYTHON = sitecustomize.py abrt_exception_handler.py EXTRA_DIST = abrt_exception_handler.py.in $(man_MANS) -pyhookconfdir = $(CONF_DIR) -dist_pyhookconf_DATA = pyhook.conf - CLEANFILES := $(notdir $(wildcard *~)) $(notdir $(wildcard *\#)) $(notdir $(wildcard \.\#*)) $(notdir $(wildcard *.pyc)) abrt_exception_handler.py: diff --git a/src/Hooks/abrt_exception_handler.py.in b/src/Hooks/abrt_exception_handler.py.in index 6933ac00..a8da9808 100644 --- a/src/Hooks/abrt_exception_handler.py.in +++ b/src/Hooks/abrt_exception_handler.py.in @@ -133,10 +133,6 @@ def __dump_exception(out, text, tracebk): except: pass - -def __exception_window(title, text, component_name): - pass - __ACTION_STR = "" def action(what): """Describe what you want to do actually. diff --git a/src/Hooks/sitecustomize.py b/src/Hooks/sitecustomize.py index 71d8c4e1..97941e87 100644 --- a/src/Hooks/sitecustomize.py +++ b/src/Hooks/sitecustomize.py @@ -5,38 +5,41 @@ # and python interpreter runs it automatically everytime # some python script is executed. -config = None -conf = {} -try: - config = open("/etc/abrt/pyhook.conf","r") -except: - # Silently ignore if file doesn't exist. - pass - -try: - if config: - # we expect config in form - # key = value - # Enabled = yes - # this should strip - line = config.readline().lower().replace(' ','').strip('\n').split('=') - conf[line[0]] = line[1] - config.close() -except: - # Ignore silently everything, because we don't want to bother user - # if this hook doesn't work. - pass +def abrt_daemon_ok(): + try: + #FIXME: make it relocable! this will work only when installed in default path + #pidfile = open(VAR_RUN_PID_FILE, "r"); + pidfile = open("/var/run/abrt.pid", "r") + except Exception, ex: + # log the exception? + return False + + pid = pidfile.readline() + pidfile.close() + if not pid: + return False + + try: + # pid[:-1] strips the trailing '\n' + cmdline = open("/proc/%s/cmdline" % pid[:-1], "r").readline() + except Exception, ex: + # can't read cmdline + return False + if not ("abrtd" in cmdline): + return False + + return True -if conf.has_key("enabled"): +if abrt_daemon_ok(): # Prevent abrt exception handler from running when the abrtd daemon is # not active. - # abrtd sets the value to "no" when deactivated and vice versa. - if conf["enabled"] == "yes": - try: - from abrt_exception_handler import * + try: + from abrt_exception_handler import installExceptionHandler - installExceptionHandler(debug = 1) - except Exception, e: - # FIXME don't print anything, write it to some log file - print e - pass + installExceptionHandler(debug = 1) + except Exception, e: + # FIXME: log errors? + pass +else: + #FIXME: log something? + pass -- cgit From 97a24dc4cce996910268c3915ee778a26e55ee20 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Tue, 8 Dec 2009 13:29:27 +0100 Subject: removed un needed files --- src/Hooks/pyhook.conf | 1 - src/Hooks/pyhook.conf.5 | 16 ---------------- 2 files changed, 17 deletions(-) delete mode 100644 src/Hooks/pyhook.conf delete mode 100644 src/Hooks/pyhook.conf.5 (limited to 'src') diff --git a/src/Hooks/pyhook.conf b/src/Hooks/pyhook.conf deleted file mode 100644 index 731debbd..00000000 --- a/src/Hooks/pyhook.conf +++ /dev/null @@ -1 +0,0 @@ -enabled = yes diff --git a/src/Hooks/pyhook.conf.5 b/src/Hooks/pyhook.conf.5 deleted file mode 100644 index d9d8bbb0..00000000 --- a/src/Hooks/pyhook.conf.5 +++ /dev/null @@ -1,16 +0,0 @@ -.TH "pyhook.conf" "5" "1 Oct 2009" "" -.SH NAME -pyhook.conf \- configuration file for abrt -.SH DESCRIPTION -.P -This configuration file controls whether python crash handler is enabled. -It has this format: -.TP -.B enabled = \fIyes\fP | \fIno\fP -When set to "yes", crashing python programs will generate a crash report -for abrt. If not, they will not do that. -.SH "SEE ALSO" -.IR abrt (8), -.IR abrt-plugins (7) -.SH AUTHOR -Written by Jiří Moskovčák . -- cgit From 99e7fa24176499c3cf2ac001123e19e399567617 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 8 Dec 2009 15:30:18 +0100 Subject: preparatory cosmetics Signed-off-by: Denys Vlasenko --- src/Gui/CCReporterDialog.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index d943c0df..8c904bb0 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -80,8 +80,8 @@ class ReporterDialog(): toggle_renderer.set_property('activatable', True) toggle_renderer.connect( 'toggled', self.on_send_toggled, self.reportListStore ) column = gtk.TreeViewColumn('Send', toggle_renderer) - column.add_attribute( toggle_renderer, "active", 3) - column.add_attribute( toggle_renderer, "visible", 4) + column.add_attribute(toggle_renderer, "active", 3) + column.add_attribute(toggle_renderer, "visible", 4) self.tvReport.insert_column(column,0) # connect the signals self.tvReport.connect_after("size-allocate", self.on_window_resize) @@ -90,8 +90,9 @@ class ReporterDialog(): self.hydrate() # this callback is called when user press Cancel or Report button in Report dialog - def on_response(self, dialog, response_id, daemon ): - # thu button has been pressed (probably) + def on_response(self, dialog, response_id, daemon): + # the button has been pressed (probably) + print "response_id", response_id if response_id == gtk.RESPONSE_APPLY: if not (self.check_settings(daemon) and self.check_report()): dialog.stop_emission("response") -- cgit From 588bf134a73f3f78c72697b4404e18c565eb3c76 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 9 Dec 2009 11:21:35 +0100 Subject: GUI: added log window --- src/Gui/CCMainWindow.py | 11 +++++++- src/Gui/CCReporterDialog.py | 9 ++++++- src/Gui/CC_gui_functions.py | 20 +++++++++++++++ src/Gui/ccgui.glade | 36 +++++++++++++++++++++++++- src/Gui/dialogs.glade | 62 +++++++++++++++++++++++++++++++++++++++++++++ src/Gui/report.glade | 20 ++++++++++++--- 6 files changed, 152 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index ee63a406..d82ec092 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -28,6 +28,7 @@ class MainWindow(): ccdaemon = None def __init__(self): self.theme = gtk.icon_theme_get_default() + self.updates = "" try: self.ccdaemon = CCDBusBackend.DBusManager() except ABRTExceptions.IsRunning, e: @@ -170,8 +171,14 @@ class MainWindow(): gui_error_message(_("Unable to finish current task!\n%s" % message), parent_dialog=self.window) def update_cb(self, daemon, message): + self.updates += message + if self.updates[-1] != '\n': + self.updates += '\n' message = message.replace('\n',' ') self.wTree.get_widget("lStatus").set_text(message) + buff = gtk.TextBuffer() + buff.set_text(self.updates) + self.wTree.get_widget("tvUpdates").set_buffer(buff) # call to update the progressbar def progress_update_cb(self, *args): @@ -281,7 +288,7 @@ class MainWindow(): if not report: gui_error_message(_("Unable to get report!\nDebuginfo is missing?")) return - report_dialog = ReporterDialog(report, self.ccdaemon, parent=self.window) + report_dialog = ReporterDialog(report, self.ccdaemon, log=self.updates, parent=self.window) # (response, report) response, result = report_dialog.run() @@ -304,6 +311,7 @@ class MainWindow(): self.refresh_report(report) def refresh_report(self, report): + self.updates = "" self.pBarWindow.show_all() self.timer = gobject.timeout_add(100, self.progress_update_cb) @@ -324,6 +332,7 @@ class MainWindow(): self.on_dumpRowActivated(self.dlist, None, path, None) def on_dumpRowActivated(self, treeview, iter, path, user_data=None): + self.updates = "" # FIXME don't duplicate the code, move to function dumpsListStore, path = treeview.get_selection().get_selected_rows() if not path: diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index 8c904bb0..746c45c2 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -26,10 +26,11 @@ CD_ATT = "a" # response REFRESH = -50 +SHOW_LOG = -60 class ReporterDialog(): """Reporter window""" - def __init__(self, report, daemon, parent=None): + def __init__(self, report, daemon, log=None, parent=None): self.editable = [] self.row_dict = {} self.report = report @@ -87,8 +88,11 @@ class ReporterDialog(): self.tvReport.connect_after("size-allocate", self.on_window_resize) # start with the warning hidden, so it's not visible when there is no rating self.wTree.get_widget("ebErrors").hide() + self.wTree.get_widget("bLog").connect("clicked", self.show_log_cb, log) self.hydrate() + def show_log_cb(self, widget, log): + show_log(log, parent=self.window) # this callback is called when user press Cancel or Report button in Report dialog def on_response(self, dialog, response_id, daemon): # the button has been pressed (probably) @@ -97,6 +101,9 @@ class ReporterDialog(): if not (self.check_settings(daemon) and self.check_report()): dialog.stop_emission("response") self.wTree.get_widget("bSend").stop_emission("clicked") + if response_id == SHOW_LOG: + # prevent dialog from quitting the run() + dialog.stop_emission("response") def on_send_toggled(self, cell, path, model): model[path][3] = not model[path][3] diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index 511e4bce..ba895c67 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -206,6 +206,26 @@ def get_icon_for_package(theme,package): return gtk.gdk.pixbuf_new_from_file_at_size(icon_filename,22,22) else: return None + +def show_log(log, parent=None): + builder = gtk.Builder() + builderfile = "%s%sdialogs.glade" % (sys.path[0],"/") + builder.add_from_file(builderfile) + dialog = builder.get_object("LogViewer") + tevLog = builder.get_object("tevLog") + + if parent: + dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) + dialog.set_transient_for(parent) + else: + dialog.set_position (gtk.WIN_POS_CENTER) + + buff = gtk.TextBuffer() + buff.set_text(log) + tevLog.set_buffer(buff) + + dialog.run() + dialog.destroy() if __name__ == "__main__": window = gtk.Window() diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index 022f4ab0..0db3b261 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -9,11 +9,12 @@ False True center-on-parent - 270 + 470 main_window3 True + vertical 12 @@ -35,6 +36,39 @@ 1 + + + True + True + + + True + True + automatic + automatic + etched-in + + + True + True + + + + + + + True + Details + + + label_item + + + + + 2 + + diff --git a/src/Gui/dialogs.glade b/src/Gui/dialogs.glade index b5e5273a..77e78ddc 100644 --- a/src/Gui/dialogs.glade +++ b/src/Gui/dialogs.glade @@ -74,4 +74,66 @@ button1 + + 5 + Log + True + 450 + 260 + normal + False + + + True + vertical + 2 + + + True + True + automatic + automatic + + + True + True + False + + + + + 1 + + + + + True + end + + + gtk-close + True + True + True + True + + + False + False + 0 + + + + + False + end + 0 + + + + + + bClose + + diff --git a/src/Gui/report.glade b/src/Gui/report.glade index 08777fb1..fc8bcc81 100644 --- a/src/Gui/report.glade +++ b/src/Gui/report.glade @@ -212,6 +212,20 @@ True end + + + Log + -60 + True + True + True + + + False + False + 0 + + gtk-cancel @@ -224,7 +238,7 @@ False False - 0 + 1 @@ -239,7 +253,7 @@ False False - 1 + 2 @@ -253,7 +267,7 @@ False False - 2 + 3 -- cgit From 5a5f7b41f8a29727369706f5bde48b475babdc8f Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 9 Dec 2009 11:27:31 +0100 Subject: CCMainWindow.py: remove unused warning_cb Signed-off-by: Denys Vlasenko --- src/Gui/CCMainWindow.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'src') diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index d82ec092..d97b34eb 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -45,7 +45,7 @@ class MainWindow(): #Get the Main Window, and connect the "destroy" event self.window = self.wTree.get_widget("main_window3") - if (self.window): + if self.window: self.window.set_default_size(700, 480) self.window.connect("delete_event", self.delete_event_cb) self.window.connect("destroy", self.destroy) @@ -108,7 +108,6 @@ class MainWindow(): self.ccdaemon.connect("crash", self.on_data_changed_cb, None) self.ccdaemon.connect("analyze-complete", self.on_analyze_complete_cb, self.pBarWindow) self.ccdaemon.connect("abrt-error", self.error_cb) - #self.ccdaemon.connect("warning", self.warning_cb) self.ccdaemon.connect("update", self.update_cb) self.ccdaemon.connect("show", self.show_cb) self.ccdaemon.connect("daemon-state-changed", self.on_daemon_state_changed_cb) @@ -151,16 +150,6 @@ class MainWindow(): return dialog.show() - def warning_cb(self, daemon, message=None): - # try to hide the progressbar, we dont really care if it was visible .. - try: - #gobject.source_remove(self.timer) - #self.pBarWindow.hide() - pass - except Exception, e: - pass - gui_error_message("%s" % message, parent_dialog=self.window) - def error_cb(self, daemon, message=None): # try to hide the progressbar, we dont really care if it was visible .. try: -- cgit From 1ab4f7ab3ca04e0b8ba17eec75cf18345d6b3fbc Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 9 Dec 2009 14:54:51 +0100 Subject: fix incorrect wording This looked wrong: "This crash has been reported, you can find the report(s) at: Kernel oops report was uploaded." Signed-off-by: Denys Vlasenko --- src/Gui/CCMainWindow.py | 4 +++- src/Gui/CC_gui_functions.py | 8 ++++---- src/Hooks/sitecustomize.py | 6 +++--- 3 files changed, 10 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index d97b34eb..e429908e 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -218,7 +218,9 @@ class MainWindow(): dump = dumpsListStore.get_value(dumpsListStore.get_iter(path[0]), dumpsListStore.get_n_columns()-1) #move this to Dump class if dump.isReported(): - report_label = _("This crash has been reported, you can find the report(s) at:\n") + report_label = _("This crash has been reported:\n") + # plugin message follows, but at least in case of kerneloops, + # it is not informative (no URL to the report) for message in dump.getMessage().split('\n'): if message: if "http" in message[0:5] or "file:///"[0:8] in message: diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index ba895c67..dfed2248 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -206,24 +206,24 @@ def get_icon_for_package(theme,package): return gtk.gdk.pixbuf_new_from_file_at_size(icon_filename,22,22) else: return None - + def show_log(log, parent=None): builder = gtk.Builder() builderfile = "%s%sdialogs.glade" % (sys.path[0],"/") builder.add_from_file(builderfile) dialog = builder.get_object("LogViewer") tevLog = builder.get_object("tevLog") - + if parent: dialog.set_position (gtk.WIN_POS_CENTER_ON_PARENT) dialog.set_transient_for(parent) else: dialog.set_position (gtk.WIN_POS_CENTER) - + buff = gtk.TextBuffer() buff.set_text(log) tevLog.set_buffer(buff) - + dialog.run() dialog.destroy() diff --git a/src/Hooks/sitecustomize.py b/src/Hooks/sitecustomize.py index 97941e87..8027726b 100644 --- a/src/Hooks/sitecustomize.py +++ b/src/Hooks/sitecustomize.py @@ -13,12 +13,12 @@ def abrt_daemon_ok(): except Exception, ex: # log the exception? return False - + pid = pidfile.readline() pidfile.close() if not pid: return False - + try: # pid[:-1] strips the trailing '\n' cmdline = open("/proc/%s/cmdline" % pid[:-1], "r").readline() @@ -27,7 +27,7 @@ def abrt_daemon_ok(): return False if not ("abrtd" in cmdline): return False - + return True if abrt_daemon_ok(): -- cgit From e32ed17a382a2c7e9836a943aec81fc5db942024 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 9 Dec 2009 16:06:55 +0100 Subject: better wording to dbus error message (bug 106) See https://fedorahosted.org/abrt/ticket/106 Signed-off-by: Denys Vlasenko --- src/Daemon/CommLayerServerDBus.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 646974dd..7c2d4657 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -538,7 +538,8 @@ static void handle_dbus_err(bool error_flag, DBusError *err) return; error_msg_and_die( "Error requesting DBus name %s, possible reasons: " - "abrt run by non-root; dbus config is incorrect", + "abrt run by non-root; dbus config is incorrect; " + "or dbus daemon needs to be restarted to reload dbus config", ABRTD_DBUS_NAME); } -- cgit From c6cfcc792147083ab41eb990f8ee4e3150cd5d75 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 9 Dec 2009 19:48:19 +0100 Subject: Gui: make report status window's text wrap. Fixes bug 82 See https://fedorahosted.org/abrt/ticket/82 Signed-off-by: Denys Vlasenko --- src/Gui/CCReporterDialog.py | 2 +- src/Gui/CC_gui_functions.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index 746c45c2..219512ea 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -96,7 +96,7 @@ class ReporterDialog(): # this callback is called when user press Cancel or Report button in Report dialog def on_response(self, dialog, response_id, daemon): # the button has been pressed (probably) - print "response_id", response_id + # print "response_id", response_id if response_id == gtk.RESPONSE_APPLY: if not (self.check_settings(daemon) and self.check_report()): dialog.stop_emission("response") diff --git a/src/Gui/CC_gui_functions.py b/src/Gui/CC_gui_functions.py index dfed2248..0532ab79 100644 --- a/src/Gui/CC_gui_functions.py +++ b/src/Gui/CC_gui_functions.py @@ -45,9 +45,12 @@ def gui_report_dialog ( report_status_dict, parent_dialog, plugin_label = Label() plugin_label.set_markup("%s: " % plugin) plugin_label.set_justify(gtk.JUSTIFY_RIGHT) + plugin_label.set_alignment(0, 0) status_label = Label() status_label.set_max_width_chars(MAX_WIDTH) status_label.set_selectable(True) + status_label.set_line_wrap(True) + status_label.set_alignment(0, 0) status_hbox.pack_start(plugin_label, expand=False) status_hbox.pack_start(status_label, expand=False) # 0 means not succesfull -- cgit From c6ed808433148bd8a704b313010bd57bbaa381d1 Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 9 Dec 2009 19:55:23 +0100 Subject: show comment and how to reproduce fields, when BT rating > 3 --- src/Gui/CCReporterDialog.py | 2 -- 1 file changed, 2 deletions(-) (limited to 'src') diff --git a/src/Gui/CCReporterDialog.py b/src/Gui/CCReporterDialog.py index 746c45c2..8ff52acd 100644 --- a/src/Gui/CCReporterDialog.py +++ b/src/Gui/CCReporterDialog.py @@ -243,8 +243,6 @@ class ReporterDialog(): # probably usable 3 elif int(self.report[item][CD_CONTENT]) < 4: ebErrors.show() - fReproducer.hide() - fComments.hide() lErrors.set_markup(_("The backtrace is incomplete, please make sure you provide good steps to reproduce.")) bSend.set_sensitive(True) else: -- cgit From 86930df464c57f84a461e4a98e5f813bff73952d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 10 Dec 2009 13:04:51 +0100 Subject: applet: make animation stop after 1 minute. (closes bug 108) See https://fedorahosted.org/abrt/ticket/108 Signed-off-by: Denys Vlasenko --- src/Applet/CCApplet.cpp | 4 ++++ src/Applet/CCApplet.h | 1 + 2 files changed, 5 insertions(+) (limited to 'src') diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp index b73b41d0..e6b89d2f 100644 --- a/src/Applet/CCApplet.cpp +++ b/src/Applet/CCApplet.cpp @@ -309,6 +309,9 @@ gboolean CApplet::update_icon(void *user_data) if(applet->m_iAnimationStage == ICON_STAGE_LAST){ applet->m_iAnimationStage = 0; } + if (--applet->m_iAnimCountdown == 0) { + applet->stop_animate_icon(); + } return true; } @@ -317,6 +320,7 @@ void CApplet::animate_icon() if(m_iAnimator == 0) { m_iAnimator = g_timeout_add(100, update_icon, this); + m_iAnimCountdown = 10 * 60; /* 60 sec */ } } diff --git a/src/Applet/CCApplet.h b/src/Applet/CCApplet.h index 6c47c0a1..15ac2f7f 100644 --- a/src/Applet/CCApplet.h +++ b/src/Applet/CCApplet.h @@ -41,6 +41,7 @@ class CApplet bool m_bDaemonRunning; int m_iAnimationStage; guint m_iAnimator; + unsigned m_iAnimCountdown; bool m_bIconsLoaded; enum ICON_STAGES -- cgit From fc2c5e2f02e6da00e27d68a83277a61efdcc9f83 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 10 Dec 2009 13:10:43 +0100 Subject: style fixes, no code changes Signed-off-by: Denys Vlasenko --- src/Applet/Applet.cpp | 2 +- src/Applet/CCApplet.cpp | 18 +++++++++--------- src/Applet/CCApplet.h | 2 +- src/CLI/CLI.cpp | 2 +- src/Daemon/CommLayerServerSocket.cpp | 2 +- src/Daemon/Daemon.cpp | 2 +- src/Daemon/RPM.cpp | 2 +- 7 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index 46278c62..14707697 100644 --- a/src/Applet/Applet.cpp +++ b/src/Applet/Applet.cpp @@ -135,7 +135,7 @@ static void NameOwnerChanged(DBusMessage* signal) } // hide icon if it's visible - as NM and don't show it, if it's not - if(!new_owner[0]) + if (!new_owner[0]) applet->HideIcon(); } diff --git a/src/Applet/CCApplet.cpp b/src/Applet/CCApplet.cpp index e6b89d2f..5d13ab87 100644 --- a/src/Applet/CCApplet.cpp +++ b/src/Applet/CCApplet.cpp @@ -114,7 +114,7 @@ CApplet::CApplet() m_iAnimationStage = ICON_DEFAULT; m_bIconsLoaded = load_icons(); /* - animation - */ - if(m_bIconsLoaded == true) + if (m_bIconsLoaded == true) { m_pStatusIcon = gtk_status_icon_new_from_pixbuf(icon_stages_buff[ICON_DEFAULT]); } @@ -244,7 +244,7 @@ void CApplet::ShowIcon() { gtk_status_icon_set_visible(m_pStatusIcon, true); /* only animate if all icons are loaded, use the "gtk-warning" instead */ - if(m_bIconsLoaded) + if (m_bIconsLoaded) animate_icon(); } @@ -300,13 +300,13 @@ void CApplet::Enable(const char *reason) gboolean CApplet::update_icon(void *user_data) { CApplet* applet = (CApplet*)user_data; - if(applet->m_pStatusIcon && applet->m_iAnimationStage < ICON_STAGE_LAST){ + if (applet->m_pStatusIcon && applet->m_iAnimationStage < ICON_STAGE_LAST) { gtk_status_icon_set_from_pixbuf(applet->m_pStatusIcon, applet->icon_stages_buff[applet->m_iAnimationStage++]); } else error_msg("icon is null"); - if(applet->m_iAnimationStage == ICON_STAGE_LAST){ + if (applet->m_iAnimationStage == ICON_STAGE_LAST) { applet->m_iAnimationStage = 0; } if (--applet->m_iAnimCountdown == 0) { @@ -317,7 +317,7 @@ gboolean CApplet::update_icon(void *user_data) void CApplet::animate_icon() { - if(m_iAnimator == 0) + if (m_iAnimator == 0) { m_iAnimator = g_timeout_add(100, update_icon, this); m_iAnimCountdown = 10 * 60; /* 60 sec */ @@ -327,7 +327,7 @@ void CApplet::animate_icon() void CApplet::stop_animate_icon() { /* animator should be 0 if icons are not loaded, so this should be safe */ - if(m_iAnimator != 0){ + if (m_iAnimator != 0) { g_source_remove(m_iAnimator); gtk_status_icon_set_from_pixbuf(m_pStatusIcon, icon_stages_buff[ICON_DEFAULT]); m_iAnimator = 0; @@ -337,13 +337,13 @@ void CApplet::stop_animate_icon() bool CApplet::load_icons() { int stage; - for(stage = ICON_DEFAULT; stage < ICON_STAGE_LAST; stage++) + for (stage = ICON_DEFAULT; stage < ICON_STAGE_LAST; stage++) { char name[sizeof(ICON_DIR"/abrt%02d.png")]; GError *error = NULL; - if(snprintf(name, sizeof(ICON_DIR"/abrt%02d.png"),ICON_DIR"/abrt%02d.png", stage) > 0){ + if (snprintf(name, sizeof(ICON_DIR"/abrt%02d.png"), ICON_DIR"/abrt%02d.png", stage) > 0) { icon_stages_buff[stage] = gdk_pixbuf_new_from_file(name, &error); - if(error != NULL){ + if (error != NULL) { error_msg("Can't load pixbuf from %s, animation is disabled!", name); return false; } diff --git a/src/Applet/CCApplet.h b/src/Applet/CCApplet.h index 15ac2f7f..48dbabcc 100644 --- a/src/Applet/CCApplet.h +++ b/src/Applet/CCApplet.h @@ -77,7 +77,7 @@ class CApplet protected: //@@TODO applet menus - static void OnAppletActivate_CB(GtkStatusIcon *status_icon,gpointer user_data); + static void OnAppletActivate_CB(GtkStatusIcon *status_icon, gpointer user_data); static void OnMenuPopup_cb(GtkStatusIcon *status_icon, guint button, guint activate_time, diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index 9f2db3f0..ac686ba3 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -131,7 +131,7 @@ int main(int argc, char** argv) char* uuid = NULL; int op = -1; - setlocale(LC_ALL,""); + setlocale(LC_ALL, ""); #if ENABLE_NLS bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp index 80dabb71..0c5f2e31 100644 --- a/src/Daemon/CommLayerServerSocket.cpp +++ b/src/Daemon/CommLayerServerSocket.cpp @@ -219,7 +219,7 @@ vector_crash_infos_t CCommLayerServerSocket::GetCrashInfos(const std::string &pS } //reimplement as CreateReportThread(...)? -//map_crash_report_t CCommLayerServerSocket::CreateReport(const std::string &pUUID,const std::string &pSender) +//map_crash_report_t CCommLayerServerSocket::CreateReport(const std::string &pUUID, const std::string &pSender) //{ // map_crash_report_t crashReport; // crashReport = ::CreateReport(pUUID, pSender); diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 1fa324fc..3f882306 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -667,7 +667,7 @@ int main(int argc, char** argv) int opt; int parent_pid = getpid(); - setlocale(LC_ALL,""); + setlocale(LC_ALL, ""); #if ENABLE_NLS bindtextdomain(PACKAGE, LOCALEDIR); diff --git a/src/Daemon/RPM.cpp b/src/Daemon/RPM.cpp index 4a819b5d..b3cf2c1c 100644 --- a/src/Daemon/RPM.cpp +++ b/src/Daemon/RPM.cpp @@ -146,7 +146,7 @@ std::string GetComponent(const char* pFileName) if (header != NULL) { rpmtd td = rpmtdNew(); - headerGet(header,RPMTAG_SOURCERPM, td, HEADERGET_DEFAULT); + headerGet(header, RPMTAG_SOURCERPM, td, HEADERGET_DEFAULT); const char * srpm = rpmtdGetString(td); if (srpm != NULL) { -- cgit From b07c8d78cbad077ea0596b90b370e2db0fe8b577 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 10 Dec 2009 13:55:24 +0100 Subject: make "abrt-cli --delete randomuuid" report that deletion failed. closes bug 59 Signed-off-by: Denys Vlasenko --- src/CLI/ABRTSocket.h | 2 +- src/CLI/CLI.cpp | 9 ++++-- src/CLI/dbus.cpp | 58 ++++++++++++++++++++++++-------------- src/CLI/dbus.h | 2 +- src/Daemon/CommLayerServerDBus.cpp | 32 ++++++++++++--------- src/Daemon/CrashWatcher.cpp | 6 +++- src/Daemon/CrashWatcher.h | 2 +- 7 files changed, 71 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/CLI/ABRTSocket.h b/src/CLI/ABRTSocket.h index 536e4b50..c3a63e51 100644 --- a/src/CLI/ABRTSocket.h +++ b/src/CLI/ABRTSocket.h @@ -23,7 +23,7 @@ class CABRTSocket vector_crash_infos_t GetCrashInfos(); map_crash_report_t CreateReport(const char *pUUID); void Report(const map_crash_report_t& pReport); - void DeleteDebugDump(const char *pUUID); + int32_t DeleteDebugDump(const char *pUUID); }; #endif /* ABRTSOCKET_H_ */ diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index ac686ba3..1f7e5430 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -183,6 +183,7 @@ int main(int argc, char** argv) ABRTDaemon.Connect(VAR_RUN"/abrt.socket"); #endif + int exitcode = 0; switch (op) { case OPT_GET_LIST: @@ -200,7 +201,11 @@ int main(int argc, char** argv) break; case OPT_DELETE: { - call_DeleteDebugDump(uuid); + if (call_DeleteDebugDump(uuid) != 0) + { + log("Can't delete debug dump with UUID '%s'", uuid); + exitcode = 1; + } break; } } @@ -209,5 +214,5 @@ int main(int argc, char** argv) ABRTDaemon.Disconnect(); #endif - return 0; + return exitcode; } diff --git a/src/CLI/dbus.cpp b/src/CLI/dbus.cpp index 2da9d745..f25165bb 100644 --- a/src/CLI/dbus.cpp +++ b/src/CLI/dbus.cpp @@ -106,41 +106,45 @@ static DBusMessage* send_get_reply_and_unref(DBusMessage* msg) vector_crash_infos_t call_GetCrashInfos() { - DBusMessage* msg = new_call_msg("GetCrashInfos"); + DBusMessage* msg = new_call_msg(__func__ + 5); DBusMessage *reply = send_get_reply_and_unref(msg); - vector_crash_infos_t argout; DBusMessageIter in_iter; dbus_message_iter_init(reply, &in_iter); + + vector_crash_infos_t argout; int r = load_val(&in_iter, argout); if (r != ABRT_DBUS_LAST_FIELD) /* more values present, or bad type */ - error_msg_and_die("dbus call %s: return type mismatch", "GetCrashInfos"); + error_msg_and_die("dbus call %s: return type mismatch", __func__ + 5); + dbus_message_unref(reply); return argout; } map_crash_report_t call_CreateReport(const char* uuid) { - DBusMessage* msg = new_call_msg("CreateReport"); + DBusMessage* msg = new_call_msg(__func__ + 5); dbus_message_append_args(msg, DBUS_TYPE_STRING, &uuid, DBUS_TYPE_INVALID); DBusMessage *reply = send_get_reply_and_unref(msg); - map_crash_report_t argout; DBusMessageIter in_iter; dbus_message_iter_init(reply, &in_iter); + + map_crash_report_t argout; int r = load_val(&in_iter, argout); if (r != ABRT_DBUS_LAST_FIELD) /* more values present, or bad type */ - error_msg_and_die("dbus call %s: return type mismatch", "CreateReport"); + error_msg_and_die("dbus call %s: return type mismatch", __func__ + 5); + dbus_message_unref(reply); return argout; } void call_Report(const map_crash_report_t& report) { - DBusMessage* msg = new_call_msg("Report"); + DBusMessage* msg = new_call_msg(__func__ + 5); DBusMessageIter out_iter; dbus_message_iter_init_append(msg, &out_iter); store_val(&out_iter, report); @@ -152,31 +156,42 @@ void call_Report(const map_crash_report_t& report) dbus_message_unref(reply); } -void call_DeleteDebugDump(const char* uuid) +int32_t call_DeleteDebugDump(const char* uuid) { - DBusMessage* msg = new_call_msg("DeleteDebugDump"); + DBusMessage* msg = new_call_msg(__func__ + 5); dbus_message_append_args(msg, DBUS_TYPE_STRING, &uuid, DBUS_TYPE_INVALID); DBusMessage *reply = send_get_reply_and_unref(msg); + DBusMessageIter in_iter; + dbus_message_iter_init(reply, &in_iter); + + int32_t result; + int r = load_val(&in_iter, result); + if (r != ABRT_DBUS_LAST_FIELD) /* more values present, or bad type */ + error_msg_and_die("dbus call %s: return type mismatch", __func__ + 5); + dbus_message_unref(reply); + return result; } vector_map_string_t call_GetPluginsInfo() { - DBusMessage *msg = new_call_msg("GetPluginsInfo"); - DBusMessage *reply = send_get_reply_and_unref(msg); - - vector_map_string_t argout; - DBusMessageIter in_iter; - dbus_message_iter_init(reply, &in_iter); - int r = load_val(&in_iter, argout); - if (r != ABRT_DBUS_LAST_FIELD) /* more values present, or bad type */ - error_msg_and_die("dbus call GetPluginsInfo: return type mismatch"); - dbus_message_unref(reply); - return argout; + DBusMessage *msg = new_call_msg(__func__ + 5); + DBusMessage *reply = send_get_reply_and_unref(msg); + + DBusMessageIter in_iter; + dbus_message_iter_init(reply, &in_iter); + + vector_map_string_t argout; + int r = load_val(&in_iter, argout); + if (r != ABRT_DBUS_LAST_FIELD) /* more values present, or bad type */ + error_msg_and_die("dbus call %s: return type mismatch", __func__ + 5); + + dbus_message_unref(reply); + return argout; } void handle_dbus_err(bool error_flag, DBusError *err) @@ -191,6 +206,7 @@ void handle_dbus_err(bool error_flag, DBusError *err) return; error_msg_and_die( "error requesting DBus name %s, possible reasons: " - "abrt run by non-root; dbus config is incorrect", + "abrt run by non-root; dbus config is incorrect; " + "or dbus daemon needs to be restarted to reload dbus config", ABRTD_DBUS_NAME); } diff --git a/src/CLI/dbus.h b/src/CLI/dbus.h index 48d391e6..f39f5381 100644 --- a/src/CLI/dbus.h +++ b/src/CLI/dbus.h @@ -26,7 +26,7 @@ extern DBusConnection* s_dbus_conn; extern vector_crash_infos_t call_GetCrashInfos(); extern map_crash_report_t call_CreateReport(const char *uuid); extern void call_Report(const map_crash_report_t& report); -extern void call_DeleteDebugDump(const char* uuid); +extern int32_t call_DeleteDebugDump(const char* uuid); /* Gets basic data about all installed plugins. */ diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 7c2d4657..9222c594 100644 --- a/src/Daemon/CommLayerServerDBus.cpp +++ b/src/Daemon/CommLayerServerDBus.cpp @@ -135,9 +135,9 @@ static int handle_GetCrashInfos(DBusMessage* call, DBusMessage* reply) long unix_uid = get_remote_uid(call); vector_crash_infos_t argout1 = GetCrashInfos(to_string(unix_uid).c_str()); - DBusMessageIter iter; - dbus_message_iter_init_append(reply, &iter); - store_val(&iter, argout1); + DBusMessageIter out_iter; + dbus_message_iter_init_append(reply, &out_iter); + store_val(&out_iter, argout1); send_flush_and_unref(reply); return 0; @@ -313,7 +313,11 @@ static int handle_DeleteDebugDump(DBusMessage* call, DBusMessage* reply) } long unix_uid = get_remote_uid(call); - DeleteDebugDump(argin1, to_string(unix_uid).c_str()); + int32_t result = DeleteDebugDump(argin1, to_string(unix_uid).c_str()); + + DBusMessageIter out_iter; + dbus_message_iter_init_append(reply, &out_iter); + store_val(&out_iter, result); send_flush_and_unref(reply); return 0; @@ -323,9 +327,9 @@ static int handle_GetPluginsInfo(DBusMessage* call, DBusMessage* reply) { vector_map_string_t plugins_info = g_pPluginManager->GetPluginsInfo(); - DBusMessageIter iter; - dbus_message_iter_init_append(reply, &iter); - store_val(&iter, plugins_info); + DBusMessageIter out_iter; + dbus_message_iter_init_append(reply, &out_iter); + store_val(&out_iter, plugins_info); send_flush_and_unref(reply); return 0; @@ -348,9 +352,10 @@ static int handle_GetPluginSettings(DBusMessage* call, DBusMessage* reply) VERB1 log("got %s('%s') call from uid %ld", "GetPluginSettings", PluginName, unix_uid); map_plugin_settings_t plugin_settings = g_pPluginManager->GetPluginSettings(PluginName, to_string(unix_uid).c_str()); - DBusMessageIter iter; - dbus_message_iter_init_append(reply, &iter); - store_val(&iter, plugin_settings); + DBusMessageIter out_iter; + dbus_message_iter_init_append(reply, &out_iter); + store_val(&out_iter, plugin_settings); + send_flush_and_unref(reply); return 0; } @@ -432,9 +437,10 @@ static int handle_GetSettings(DBusMessage* call, DBusMessage* reply) { map_abrt_settings_t result = GetSettings(); - DBusMessageIter iter; - dbus_message_iter_init_append(reply, &iter); - store_val(&iter, result); + DBusMessageIter out_iter; + dbus_message_iter_init_append(reply, &out_iter); + store_val(&out_iter, result); + send_flush_and_unref(reply); return 0; } diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 3684d600..88c058b0 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -193,7 +193,7 @@ int CreateReportThread(const char* pUUID, const char* pUID, int force, const cha /* Remove dump dir and its DB record */ -void DeleteDebugDump(const char *pUUID, const char *pUID) +int DeleteDebugDump(const char *pUUID, const char *pUID) { try { @@ -205,12 +205,16 @@ void DeleteDebugDump(const char *pUUID, const char *pUID) const char *dump_dir = row.m_sDebugDumpDir.c_str(); if (dump_dir[0] != '\0') + { delete_debug_dump_dir(dump_dir); + return 0; /* success */ + } } catch (CABRTException& e) { error_msg("%s", e.what()); } + return -1; /* failure */ } void DeleteDebugDump_by_dir(const char *dump_dir) diff --git a/src/Daemon/CrashWatcher.h b/src/Daemon/CrashWatcher.h index a8064367..8d56c4ec 100644 --- a/src/Daemon/CrashWatcher.h +++ b/src/Daemon/CrashWatcher.h @@ -51,7 +51,7 @@ class CCrashWatcher vector_crash_infos_t GetCrashInfos(const char *pUID); int CreateReportThread(const char* pUUID, const char* pUID, int force, const char* pSender); map_crash_report_t CreateReport(const char* pUUID, const char* pUID, int force); -void DeleteDebugDump(const char *pUUID, const char *pUID); +int DeleteDebugDump(const char *pUUID, const char *pUID); void DeleteDebugDump_by_dir(const char *dump_dir); #endif -- cgit From 982fad340ad46b81257cfeb17f80fd6ca90ebc18 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 10 Dec 2009 14:29:52 +0100 Subject: abrtd: fix manpage: s/abrt/abrtd/; document -s and -v Signed-off-by: Denys Vlasenko --- src/Daemon/abrtd.8 | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/Daemon/abrtd.8 b/src/Daemon/abrtd.8 index b106041d..150f0c3d 100644 --- a/src/Daemon/abrtd.8 +++ b/src/Daemon/abrtd.8 @@ -1,10 +1,10 @@ -.TH abrt "8" "28 May 2009" "" +.TH abrtd "8" "28 May 2009" "" .SH NAME -abrt \- an automated bug-reporting tool +abrtd \- automated bug reporting tool's daemon .SH SYNOPSIS -.B abrt [ -d ] +.B abrtd [-dsv[v]...] .SH DESCRIPTION -.I abrt +.I abrtd is a daemon that watches for application crashes. When a crash occurs, it collects the crash data (core file, application's command line etc.) and takes action according to the type of application that @@ -17,17 +17,22 @@ respective plugins. .SH OPTIONS .TP - .B "\-d" -This option causes -.I abrt -to print more debugging information when the daemon is started. +Stay in the foreground and log to standard error. +.TP +.B "\-s" + +Log to system log even with option -d. +.TP +.B "\-v" + +Log more detailed debugging information. .SH CAVEATS -When you use some other crash-catching tool, specific for an application +When you use some other crash-catching tool specific for an application or an application type (for example BugBuddy for GNOME applications), crashes of this type will be handled by that tool and -not by \fIabrt\fP. If you want \fIabrt\fP to handle these crashes, +not by \fIabrtd\fP. If you want \fIabrtd\fP to handle these crashes, turn off the higher-level crash-catching tool. .SH "SEE ALSO" .IR abrt.conf (5), -- cgit From ef7b2ad3c40de029e4eda05a2454e6555e3a8a82 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 10 Dec 2009 14:45:15 +0100 Subject: abrtd: add comment about ccpp/abrtd race Signed-off-by: Denys Vlasenko --- src/Daemon/Daemon.cpp | 6 ++++++ src/Hooks/CCpp.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 3f882306..6f98966c 100644 --- a/src/Daemon/Daemon.cpp +++ b/src/Daemon/Daemon.cpp @@ -456,6 +456,12 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin continue; } +//TODO: make it possible to detect when ccpp didn't finish dumping yet. +//We are seeing it *before* ccpp finished, and it can take LONG time +//(users saw 100+ seconds). +//This floods syslog with "Lock file 'XXXXXX' is locked by process NNN" +//Maybe ccpp should use XXXXXX.new name for incomplete dumps +//and abrtd should watch for renames XXXXXX.new -> XXXXXX? log("Directory '%s' creation detected", name); std::string worst_dir; diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp index ea616860..fdb31a5c 100644 --- a/src/Hooks/CCpp.cpp +++ b/src/Hooks/CCpp.cpp @@ -20,7 +20,7 @@ */ /* Make all file ops "large" and make off_t 64-bit. - * No need to use O_LORGEFILE anywhere + * No need to use O_LARGEFILE anywhere */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE -- cgit From 8bbbdab7f576eeb4233eeaf3f6f9df85fb745c6d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 10 Dec 2009 17:12:21 +0100 Subject: mkde abrt-gui --help and --version behave as expected. closes bug 85 See https://fedorahosted.org/abrt/ticket/85 Signed-off-by: Denys Vlasenko --- src/Gui/Makefile.am | 3 ++- src/Gui/abrt-gui | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Gui/Makefile.am b/src/Gui/Makefile.am index 7f61bbce..60a7bfe3 100644 --- a/src/Gui/Makefile.am +++ b/src/Gui/Makefile.am @@ -2,7 +2,7 @@ bin_SCRIPTS = abrt-gui -PYTHON_FILES = CCDBusBackend.py CCDumpList.py CCDump.py CC_gui_functions.py \ +PYTHON_FILES = CCDBusBackend.py CCDumpList.py CCDump.py CC_gui_functions.py \ CCReporterDialog.py CCReport.py abrt_utils.py \ CCMainWindow.py CellRenderers.py ABRTExceptions.py \ SettingsDialog.py ABRTPlugin.py PluginList.py PluginSettingsUI.py \ @@ -28,4 +28,5 @@ abrt.desktop: install-exec-hook: for b in $(bin_SCRIPTS); do \ sed 's:/usr/share:$(datadir):g' -i $(DESTDIR)$(bindir)/$$b || exit $$?; \ + sed 's:VERSION:@VERSION@:g' -i $(DESTDIR)$(bindir)/$$b || exit $$?; \ done diff --git a/src/Gui/abrt-gui b/src/Gui/abrt-gui index 85bdebbc..78379be7 100755 --- a/src/Gui/abrt-gui +++ b/src/Gui/abrt-gui @@ -1,4 +1,8 @@ #!/bin/sh +if test x"$1" = x"--help" || test x"$1" = x"--version"; then + echo "abrt-gui VERSION" + exit 0 +fi export PYTHONPATH=/usr/share/abrt export XLOGNAME=$LOGNAME exec /usr/bin/python /usr/share/abrt/CCMainWindow.py "$@" -- cgit From 3817450dfabec31c085b38dceb34c7bf50d78000 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 10 Dec 2009 17:36:59 +0100 Subject: made BarWindow resizable, otherwise log text view is tiny Signed-off-by: Denys Vlasenko --- src/Gui/ccgui.glade | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/Gui/ccgui.glade b/src/Gui/ccgui.glade index 0db3b261..b12a631c 100644 --- a/src/Gui/ccgui.glade +++ b/src/Gui/ccgui.glade @@ -6,7 +6,6 @@ 270 12 Please wait.. - False True center-on-parent 470 -- cgit From 28ce06fe5aacf7ba175a2d43981f43990064a621 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 10 Dec 2009 17:44:08 +0100 Subject: fix English Signed-off-by: Denys Vlasenko --- src/Gui/report.glade | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Gui/report.glade b/src/Gui/report.glade index fc8bcc81..0eae1f16 100644 --- a/src/Gui/report.glade +++ b/src/Gui/report.glade @@ -55,7 +55,7 @@ True - <b>Following items will be send</b> + <b>Following items will be sent</b> True -- cgit From 7ee6b78b9f901e84be31117940ab7ab8af631e9d Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 10 Dec 2009 18:26:37 +0100 Subject: remove one case when we write data needlessly; remove 2 unused funcs Signed-off-by: Denys Vlasenko --- src/Daemon/MiddleWare.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index e7757648..e483f3fe 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -427,12 +427,12 @@ report_status_t Report(const map_crash_report_t& pCrashReport, std::string packageNVR = pCrashReport.find(FILENAME_PACKAGE)->second[CD_CONTENT]; std::string packageName = packageNVR.substr(0, packageNVR.rfind("-", packageNVR.rfind("-") - 1)); - // Save comments and how to reproduciton + // Save comment and "how to reproduce" map_crash_report_t::const_iterator it_comment = pCrashReport.find(CD_COMMENT); map_crash_report_t::const_iterator it_reproduce = pCrashReport.find(CD_REPRODUCE); - std::string pDumpDir = getDebugDumpDir(UUID.c_str(), UID.c_str()); - + if (it_comment != pCrashReport.end() || it_reproduce != pCrashReport.end()) { + std::string pDumpDir = getDebugDumpDir(UUID.c_str(), UID.c_str()); CDebugDump dd; dd.Open(pDumpDir.c_str()); if (it_comment != pCrashReport.end()) -- cgit From 72f718d31edf9014b3b46b5215d184abad4fbe40 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 11 Dec 2009 13:36:07 +0100 Subject: abrt-applet: downgrade annoying log() to VERB1 log() Signed-off-by: Denys Vlasenko --- src/Applet/Applet.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Applet/Applet.cpp b/src/Applet/Applet.cpp index 14707697..eea3ef79 100644 --- a/src/Applet/Applet.cpp +++ b/src/Applet/Applet.cpp @@ -142,7 +142,8 @@ static void NameOwnerChanged(DBusMessage* signal) static DBusHandlerResult handle_message(DBusConnection* conn, DBusMessage* msg, void* user_data) { const char* member = dbus_message_get_member(msg); - log("%s(member:'%s')", __func__, member); + + VERB1 log("%s(member:'%s')", __func__, member); int type = dbus_message_get_type(msg); if (type != DBUS_MESSAGE_TYPE_SIGNAL) -- cgit From 890f62322fc8fee262e39a10428b1a2489edf267 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 11 Dec 2009 16:43:57 +0100 Subject: abrt-cli: report success/failure of reporting. closes bug 71 See https://fedorahosted.org/abrt/ticket/71 Signed-off-by: Denys Vlasenko --- src/CLI/CLI.cpp | 4 +- src/CLI/dbus.cpp | 13 +++- src/CLI/dbus.h | 14 ++--- src/CLI/report.cpp | 150 ++++++++++++++++++++++++---------------------- src/CLI/report.h | 2 +- src/Daemon/MiddleWare.cpp | 8 +-- 6 files changed, 104 insertions(+), 87 deletions(-) (limited to 'src') diff --git a/src/CLI/CLI.cpp b/src/CLI/CLI.cpp index 1f7e5430..1ea3a5d6 100644 --- a/src/CLI/CLI.cpp +++ b/src/CLI/CLI.cpp @@ -194,10 +194,10 @@ int main(int argc, char** argv) break; } case OPT_REPORT: - report(uuid, false); + exitcode = report(uuid, false); break; case OPT_REPORT_ALWAYS: - report(uuid, true); + exitcode = report(uuid, true); break; case OPT_DELETE: { diff --git a/src/CLI/dbus.cpp b/src/CLI/dbus.cpp index f25165bb..b2186798 100644 --- a/src/CLI/dbus.cpp +++ b/src/CLI/dbus.cpp @@ -142,7 +142,7 @@ map_crash_report_t call_CreateReport(const char* uuid) return argout; } -void call_Report(const map_crash_report_t& report) +report_status_t call_Report(const map_crash_report_t& report) { DBusMessage* msg = new_call_msg(__func__ + 5); DBusMessageIter out_iter; @@ -150,10 +150,17 @@ void call_Report(const map_crash_report_t& report) store_val(&out_iter, report); DBusMessage *reply = send_get_reply_and_unref(msg); - //it returns a single value of report_status_t type, - //but we don't use it (yet?) + + DBusMessageIter in_iter; + dbus_message_iter_init(reply, &in_iter); + + report_status_t result; + int r = load_val(&in_iter, result); + if (r != ABRT_DBUS_LAST_FIELD) /* more values present, or bad type */ + error_msg_and_die("dbus call %s: return type mismatch", __func__ + 5); dbus_message_unref(reply); + return result; } int32_t call_DeleteDebugDump(const char* uuid) diff --git a/src/CLI/dbus.h b/src/CLI/dbus.h index f39f5381..3c157c01 100644 --- a/src/CLI/dbus.h +++ b/src/CLI/dbus.h @@ -23,21 +23,21 @@ extern DBusConnection* s_dbus_conn; -extern vector_crash_infos_t call_GetCrashInfos(); -extern map_crash_report_t call_CreateReport(const char *uuid); -extern void call_Report(const map_crash_report_t& report); -extern int32_t call_DeleteDebugDump(const char* uuid); +vector_crash_infos_t call_GetCrashInfos(); +map_crash_report_t call_CreateReport(const char *uuid); +report_status_t call_Report(const map_crash_report_t& report); +int32_t call_DeleteDebugDump(const char* uuid); /* Gets basic data about all installed plugins. */ -extern vector_map_string_t call_GetPluginsInfo(); +vector_map_string_t call_GetPluginsInfo(); /** Gets default plugin settings. * @param name * Corresponds to name obtained from call_GetPluginsInfo. */ -extern map_plugin_settings_t call_GetPluginSettings(const char *name); +map_plugin_settings_t call_GetPluginSettings(const char *name); -extern void handle_dbus_err(bool error_flag, DBusError *err); +void handle_dbus_err(bool error_flag, DBusError *err); #endif diff --git a/src/CLI/report.cpp b/src/CLI/report.cpp index ac80e481..bc8f9008 100644 --- a/src/CLI/report.cpp +++ b/src/CLI/report.cpp @@ -332,88 +332,98 @@ int report(const char *uuid, bool always) { // Ask for an initial report. map_crash_report_t cr = call_CreateReport(uuid); +//TODO: error check? - if (always) + if (!always) { - // Send the report immediately. - call_Report(cr); - return 0; - } - - /* Open a temporary file and write the crash report to it. */ - char filename[] = "/tmp/abrt-report.XXXXXX"; - int fd = mkstemp(filename); - if (fd == -1) - { - error_msg("can't generate temporary file name"); - return 1; - } + /* Open a temporary file and write the crash report to it. */ + char filename[] = "/tmp/abrt-report.XXXXXX"; + int fd = mkstemp(filename); + if (fd == -1) + { + error_msg("can't generate temporary file name"); + return 1; + } - FILE *fp = fdopen(fd, "w"); - if (!fp) - { - error_msg("can't open '%s' to save the crash report", filename); - return 1; - } + FILE *fp = fdopen(fd, "w"); + if (!fp) + { + error_msg("can't open '%s' to save the crash report", filename); + return 1; + } - write_crash_report(cr, fp); + write_crash_report(cr, fp); - if (fclose(fp)) - { - error_msg("can't close '%s'", filename); - return 2; - } + if (fclose(fp)) + { + error_msg("can't close '%s'", filename); + return 2; + } - // Start a text editor on the temporary file. - launch_editor(filename); + // Start a text editor on the temporary file. + launch_editor(filename); - // Read the file back and update the report from the file. - fp = fopen(filename, "r"); - if (!fp) - { - error_msg("can't open '%s' to read the crash report", filename); - return 1; - } + // Read the file back and update the report from the file. + fp = fopen(filename, "r"); + if (!fp) + { + error_msg("can't open '%s' to read the crash report", filename); + return 1; + } - fseek(fp, 0, SEEK_END); - long size = ftell(fp); - fseek(fp, 0, SEEK_SET); + fseek(fp, 0, SEEK_END); + long size = ftell(fp); + fseek(fp, 0, SEEK_SET); - char *text = (char*)xmalloc(size + 1); - if (fread(text, 1, size, fp) != size) - { - error_msg("can't read '%s'", filename); - return 1; + char *text = (char*)xmalloc(size + 1); + if (fread(text, 1, size, fp) != size) + { + error_msg("can't read '%s'", filename); + return 1; + } + text[size] = '\0'; + fclose(fp); + + remove_comments_and_unescape(text); + // Updates the crash report from the file text. + int report_changed = read_crash_report(cr, text); + if (report_changed) + puts(_("\nThe report has been updated.")); + else + puts(_("\nNo changes were detected in the report.")); + + free(text); + + if (unlink(filename) != 0) // Delete the tempfile. + perror_msg("can't unlink %s", filename); + + // Report only if the user is sure. + printf(_("Do you want to send the report? [y/N]: ")); + fflush(NULL); + char answer[16] = "n"; + fgets(answer, sizeof(answer), stdin); + if ((answer[0] | 0x20) != 'y') + { + puts(_("Crash report was not sent.")); + return 0; + } } - text[size] = '\0'; - fclose(fp); - - remove_comments_and_unescape(text); - // Updates the crash report from the file text. - int report_changed = read_crash_report(cr, text); - if (report_changed) - puts(_("\nThe report has been updated.")); - else - puts(_("\nNo changes were detected in the report.")); - free(text); - - if (unlink(filename) != 0) // Delete the tempfile. - perror_msg("can't unlink %s", filename); - - // Report only if the user is sure. - printf(_("Do you want to send the report? [y/N]: ")); - fflush(NULL); - char answer[16] = "n"; - fgets(answer, sizeof(answer), stdin); - if (answer[0] == 'Y' || answer[0] == 'y') + int errors = 0; + int plugins = 0; + puts(_("Reporting...")); + report_status_t r = call_Report(cr); + report_status_t::iterator it = r.begin(); + while (it != r.end()) { - puts(_("Reporting...")); - call_Report(cr); - puts(_("Crash report was successfully sent.")); + vector_string_t &v = it->second; + printf("%s: %s\n", it->first.c_str(), v[REPORT_STATUS_IDX_MSG].c_str()); + plugins++; + if (v[REPORT_STATUS_IDX_FLAG] != "0") + errors++; + it++; } - else - puts(_("Crash report was not sent.")); + printf(_("Crash reported via %d plugins (%d errors)\n"), plugins, errors); - return 0; + return errors != 0; } diff --git a/src/CLI/report.h b/src/CLI/report.h index 888babf3..2969b650 100644 --- a/src/CLI/report.h +++ b/src/CLI/report.h @@ -19,6 +19,6 @@ #define ABRT_CLI_REPORT_H /* Reports the crash with corresponding uuid over DBus. */ -extern int report(const char *uuid, bool always); +int report(const char *uuid, bool always); #endif diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index e483f3fe..c0ffabac 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -498,15 +498,15 @@ report_status_t Report(const map_crash_report_t& pCrashReport, reporter->SetSettings(oldSettings); } #endif - ret[pluginName].push_back("1"); - ret[pluginName].push_back(res); + ret[pluginName].push_back("1"); // REPORT_STATUS_IDX_FLAG + ret[pluginName].push_back(res); // REPORT_STATUS_IDX_MSG message += res + "\n"; } } catch (CABRTException& e) { - ret[pluginName].push_back("0"); - ret[pluginName].push_back(e.what()); + ret[pluginName].push_back("0"); // REPORT_STATUS_IDX_FLAG + ret[pluginName].push_back(e.what()); // REPORT_STATUS_IDX_MSG update_client("Reporting via '%s' was not successful: %s", pluginName.c_str(), e.what()); } } -- cgit From 14852d1a5750020c569666d26f212b986571dadf Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 11 Dec 2009 19:19:03 +0100 Subject: renaming abrt-pyhook-helper -> abrt-hook-python and moving it to /usr/libexec Signed-off-by: Denys Vlasenko --- src/Hooks/Makefile.am | 12 ++++++------ src/Hooks/abrt-pyhook-helper.cpp | 4 ++-- src/Hooks/abrt_exception_handler.py.in | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/Hooks/Makefile.am b/src/Hooks/Makefile.am index af51d99a..eb71a451 100644 --- a/src/Hooks/Makefile.am +++ b/src/Hooks/Makefile.am @@ -1,5 +1,5 @@ libexec_PROGRAMS = abrt-hook-ccpp -bin_PROGRAMS = dumpoops abrt-pyhook-helper +bin_PROGRAMS = dumpoops abrt-hook-python # CCpp abrt_hook_ccpp_SOURCES = \ @@ -32,17 +32,17 @@ dumpoops_LDADD = \ ../../lib/Utils/libABRTUtils.la \ ../../lib/Utils/libABRTdUtils.la -# abrt-pyhook-helper -abrt_pyhook_helper_SOURCES = \ - abrt-pyhook-helper.cpp -abrt_pyhook_helper_CPPFLAGS = \ +# abrt-hook-python +abrt_hook_python_SOURCES = \ + abrt-hook-python.cpp +abrt_hook_python_CPPFLAGS = \ -I$(srcdir)/../../inc \ -I$(srcdir)/../../lib/Utils \ -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ -DCONF_DIR=\"$(CONF_DIR)\" \ -DVAR_RUN=\"$(VAR_RUN)\" \ -D_GNU_SOURCE -abrt_pyhook_helper_LDADD = \ +abrt_hook_python_LDADD = \ ../../lib/Utils/libABRTUtils.la python_PYTHON = sitecustomize.py abrt_exception_handler.py diff --git a/src/Hooks/abrt-pyhook-helper.cpp b/src/Hooks/abrt-pyhook-helper.cpp index 0d15d78f..cd17e402 100644 --- a/src/Hooks/abrt-pyhook-helper.cpp +++ b/src/Hooks/abrt-pyhook-helper.cpp @@ -1,5 +1,5 @@ /* - abrt-pyhook-helper.cpp - writes data to the /var/cache/abrt directory + abrt-hook-python.cpp - writes data to the /var/cache/abrt directory with SUID bit Copyright (C) 2009 RedHat inc. @@ -67,7 +67,7 @@ int main(int argc, char** argv) default: usage: error_msg_and_die( - "Usage: abrt-pyhook-helper [OPTIONS] Date: Fri, 11 Dec 2009 19:20:30 +0100 Subject: abrt-pyhook-helper rename part 2 Signed-off-by: Denys Vlasenko --- src/Hooks/abrt-hook-python.cpp | 120 +++++++++++++++++++++++++++++++++++++++ src/Hooks/abrt-pyhook-helper.cpp | 120 --------------------------------------- 2 files changed, 120 insertions(+), 120 deletions(-) create mode 100644 src/Hooks/abrt-hook-python.cpp delete mode 100644 src/Hooks/abrt-pyhook-helper.cpp (limited to 'src') diff --git a/src/Hooks/abrt-hook-python.cpp b/src/Hooks/abrt-hook-python.cpp new file mode 100644 index 00000000..cd17e402 --- /dev/null +++ b/src/Hooks/abrt-hook-python.cpp @@ -0,0 +1,120 @@ +/* + abrt-hook-python.cpp - writes data to the /var/cache/abrt directory + with SUID bit + + Copyright (C) 2009 RedHat inc. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +*/ + +#include +#include +/* We can easily get rid of abrtlib (libABRTUtils.so) usage in this file, + * but DebugDump will pull it in anyway */ +#include "abrtlib.h" +#include "DebugDump.h" +#if HAVE_CONFIG_H +# include +#endif + +#define MAX_BT_SIZE (1024*1024) + +static char *pid; +static char *executable; +static char *uuid; +static char *cmdline; + +int main(int argc, char** argv) +{ + // Parse options + static const struct option longopts[] = { + // name , has_arg , flag, val + { "pid" , required_argument, NULL, 'p' }, + { "executable", required_argument, NULL, 'e' }, + { "uuid" , required_argument, NULL, 'u' }, + { "cmdline" , required_argument, NULL, 'c' }, + { 0 }, + }; + int opt; + while ((opt = getopt_long(argc, argv, "p:e:u:c:l:", longopts, NULL)) != -1) + { + switch (opt) + { + case 'p': + pid = optarg; + break; + case 'e': + executable = optarg; + break; + case 'u': + uuid = optarg; + break; + case 'c': + cmdline = optarg; + break; + default: + usage: + error_msg_and_die( + "Usage: abrt-hook-python [OPTIONS] -#include -/* We can easily get rid of abrtlib (libABRTUtils.so) usage in this file, - * but DebugDump will pull it in anyway */ -#include "abrtlib.h" -#include "DebugDump.h" -#if HAVE_CONFIG_H -# include -#endif - -#define MAX_BT_SIZE (1024*1024) - -static char *pid; -static char *executable; -static char *uuid; -static char *cmdline; - -int main(int argc, char** argv) -{ - // Parse options - static const struct option longopts[] = { - // name , has_arg , flag, val - { "pid" , required_argument, NULL, 'p' }, - { "executable", required_argument, NULL, 'e' }, - { "uuid" , required_argument, NULL, 'u' }, - { "cmdline" , required_argument, NULL, 'c' }, - { 0 }, - }; - int opt; - while ((opt = getopt_long(argc, argv, "p:e:u:c:l:", longopts, NULL)) != -1) - { - switch (opt) - { - case 'p': - pid = optarg; - break; - case 'e': - executable = optarg; - break; - case 'u': - uuid = optarg; - break; - case 'c': - cmdline = optarg; - break; - default: - usage: - error_msg_and_die( - "Usage: abrt-hook-python [OPTIONS] Date: Fri, 11 Dec 2009 19:26:20 +0100 Subject: rename part 3, now it builds :] Signed-off-by: Denys Vlasenko --- src/Hooks/Makefile.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Hooks/Makefile.am b/src/Hooks/Makefile.am index eb71a451..75819719 100644 --- a/src/Hooks/Makefile.am +++ b/src/Hooks/Makefile.am @@ -1,5 +1,5 @@ -libexec_PROGRAMS = abrt-hook-ccpp -bin_PROGRAMS = dumpoops abrt-hook-python +libexec_PROGRAMS = abrt-hook-ccpp abrt-hook-python +bin_PROGRAMS = dumpoops # CCpp abrt_hook_ccpp_SOURCES = \ -- cgit From 348b393bdad0aaa5a849b30c6c2e205ddfbd30bc Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 11 Dec 2009 20:27:12 +0100 Subject: temporarily convert hyperlink-laden label to normal one (HL doesn't work) Signed-off-by: Denys Vlasenko --- src/Daemon/MiddleWare.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index c0ffabac..5235c172 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -604,6 +604,8 @@ static mw_result_t SavePackageDescriptionToDebugDump(const char *pExecutable, } std::string description = GetDescription(packageName.c_str()); +//TODO: if executable in /usr/bin/python, /bin/sh and such, +//we need to extract component using argv[1] std::string component = GetComponent(pExecutable); try -- cgit