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/Daemon/CrashWatcher.cpp | 4 +++- src/Daemon/Daemon.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Daemon') diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 1606f86..2973cfc 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 f9910dc..1fa324f 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/Daemon') diff --git a/src/Daemon/abrt-debuginfo-install b/src/Daemon/abrt-debuginfo-install index 23379b4..6278b63 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/Daemon') diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp index ee775c6..80dabb7 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 58151b2..82f22e8 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/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 +++--- 7 files changed, 19 insertions(+), 18 deletions(-) (limited to 'src/Daemon') diff --git a/src/Daemon/CommLayerServer.h b/src/Daemon/CommLayerServer.h index 21c1b30..367c095 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 27a18c2..646974d 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 f159c73..9bd7766 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 d1f464c..753b67a 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 2973cfc..3684d60 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 fc4f5e2..18fcd81 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 8528f64..e775764 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 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/Daemon') diff --git a/src/Daemon/abrt.conf b/src/Daemon/abrt.conf index 028f582..ee034a6 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 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/Daemon') diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 646974d..7c2d465 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 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/Daemon/CommLayerServerSocket.cpp | 2 +- src/Daemon/Daemon.cpp | 2 +- src/Daemon/RPM.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/Daemon') diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp index 80dabb7..0c5f2e3 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 1fa324f..3f88230 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 4a819b5..b3cf2c1 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/Daemon/CommLayerServerDBus.cpp | 32 +++++++++++++++++++------------- src/Daemon/CrashWatcher.cpp | 6 +++++- src/Daemon/CrashWatcher.h | 2 +- 3 files changed, 25 insertions(+), 15 deletions(-) (limited to 'src/Daemon') diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp index 7c2d465..9222c59 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 3684d60..88c058b 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 a806436..8d56c4e 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/Daemon') diff --git a/src/Daemon/abrtd.8 b/src/Daemon/abrtd.8 index b106041..150f0c3 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 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/Daemon') diff --git a/src/Daemon/Daemon.cpp b/src/Daemon/Daemon.cpp index 3f88230..6f98966 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; -- 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/Daemon') diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index e775764..e483f3f 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 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/Daemon/MiddleWare.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Daemon') diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index e483f3f..c0ffaba 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 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/Daemon') diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index c0ffaba..5235c17 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