diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-03-04 12:52:13 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2009-03-04 12:52:13 +0100 |
commit | 7d0b86ce4ce9401b7177c91874cac9e1e0ee42c7 (patch) | |
tree | 2cb061660f9ad48e8fcc8dd859f6f2aa0ff14b34 | |
parent | 6f13bfb6b3e6007d75ccc2d727d5db45c50cb57a (diff) | |
parent | 60150bac2c6ecc10a1d761bdecef696566d9ef43 (diff) | |
download | abrt-7d0b86ce4ce9401b7177c91874cac9e1e0ee42c7.tar.gz abrt-7d0b86ce4ce9401b7177c91874cac9e1e0ee42c7.tar.xz abrt-7d0b86ce4ce9401b7177c91874cac9e1e0ee42c7.zip |
Merge branch 'master' of git://git.fedorahosted.org/git/crash-catcher
24 files changed, 189 insertions, 171 deletions
@@ -9,7 +9,7 @@ # Required-Start: $syslog $local_fs # Required-Stop: $syslog $local_fs # Default-Stop: 0 1 2 3 4 5 6 -# Short-Description: start and stop crash-carcher daemon +# Short-Description: start and stop abrt daemon # Description: Listen and dispatch crash events ### END INIT INFO @@ -149,7 +149,7 @@ fi %files applet %defattr(-,root,root,-) -%{_bindir}/cc-applet +%{_bindir}/%{name}-applet %files gui %defattr(-,root,root,-) diff --git a/doc/CodingStyle b/doc/CodingStyle index 1e054013..2cc2cf6e 100644 --- a/doc/CodingStyle +++ b/doc/CodingStyle @@ -1,4 +1,4 @@ -Coding style used in CrashCatcher +Coding style used in abrt ================================= 1. Class diff --git a/lib/MiddleWare/CrashCatcherPlugin.cpp b/lib/MiddleWare/ABRTPlugin.cpp index 04ff3a82..788d5c9e 100644 --- a/lib/MiddleWare/CrashCatcherPlugin.cpp +++ b/lib/MiddleWare/ABRTPlugin.cpp @@ -1,5 +1,5 @@ /* - CrashCatcherPlugin.cpp + ABRTPlugin.cpp Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) Copyright (C) 2009 RedHat inc. @@ -19,9 +19,9 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#include "CrashCatcherPlugin.h" +#include "ABRTPlugin.h" -CCrashCatcherPlugin::CCrashCatcherPlugin(const std::string& pLibPath) : +CABRTPlugin::CABRTPlugin(const std::string& pLibPath) : m_pDynamicLibrary(NULL), m_pPluginInfo(NULL), m_pFnPluginNew(NULL) @@ -42,7 +42,7 @@ CCrashCatcherPlugin::CCrashCatcherPlugin(const std::string& pLibPath) : } } -CCrashCatcherPlugin::~CCrashCatcherPlugin() +CABRTPlugin::~CABRTPlugin() { if (m_pDynamicLibrary != NULL) { @@ -50,42 +50,42 @@ CCrashCatcherPlugin::~CCrashCatcherPlugin() } } -const std::string& CCrashCatcherPlugin::GetVersion() +const std::string& CABRTPlugin::GetVersion() { return m_pPluginInfo->m_sVersion; } -const int CCrashCatcherPlugin::GetMagicNumber() +const int CABRTPlugin::GetMagicNumber() { return m_pPluginInfo->m_nMagicNumber; } -const std::string& CCrashCatcherPlugin::GetName() +const std::string& CABRTPlugin::GetName() { return m_pPluginInfo->m_sName; } -const std::string& CCrashCatcherPlugin::GetDescription() +const std::string& CABRTPlugin::GetDescription() { return m_pPluginInfo->m_sDescription; } -const std::string& CCrashCatcherPlugin::GetEmail() +const std::string& CABRTPlugin::GetEmail() { return m_pPluginInfo->m_sEmail; } -const std::string& CCrashCatcherPlugin::GetWWW() +const std::string& CABRTPlugin::GetWWW() { return m_pPluginInfo->m_sWWW; } -const plugin_type_t CCrashCatcherPlugin::GetType() +const plugin_type_t CABRTPlugin::GetType() { return m_pPluginInfo->m_Type; } -CPlugin* CCrashCatcherPlugin::PluginNew() +CPlugin* CABRTPlugin::PluginNew() { return m_pFnPluginNew(); } diff --git a/lib/MiddleWare/CrashCatcherPlugin.h b/lib/MiddleWare/ABRTPlugin.h index 43e59af9..0bf078bf 100644 --- a/lib/MiddleWare/CrashCatcherPlugin.h +++ b/lib/MiddleWare/ABRTPlugin.h @@ -1,5 +1,5 @@ /* - CrashCatcherPlugin.h - header file for CrashCatcher plugin. It takes care + ABRTPlugin.h - header file for abrt plugin. It takes care of reporting thinks which has loaded plugin. Copyright (C) 2009 Zdenek Prikryl (zprikryl@redhat.com) @@ -21,14 +21,14 @@ */ -#ifndef CRASHCATCHERPLUGIN_H_ -#define CRASHCATCHERPLUGIN_H_ +#ifndef ABRTPLUGIN_H_ +#define ABRTPLUGIN_H_ #include <string> #include "DynamicLibrary.h" #include "Plugin.h" -class CCrashCatcherPlugin +class CABRTPlugin { private: @@ -40,8 +40,8 @@ class CCrashCatcherPlugin p_fn_plugin_new_t m_pFnPluginNew; public: - CCrashCatcherPlugin(const std::string& pLibPath); - ~CCrashCatcherPlugin(); + CABRTPlugin(const std::string& pLibPath); + ~CABRTPlugin(); const std::string& GetVersion(); const int GetMagicNumber(); @@ -54,4 +54,4 @@ class CCrashCatcherPlugin CPlugin* PluginNew(); }; -#endif /*CRASHCATCHERPLUGIN_H_*/ +#endif /*ABRTPLUGIN_H_*/ diff --git a/lib/MiddleWare/Makefile.am b/lib/MiddleWare/Makefile.am index ee292376..27eda453 100644 --- a/lib/MiddleWare/Makefile.am +++ b/lib/MiddleWare/Makefile.am @@ -1,9 +1,9 @@ lib_LTLIBRARIES = libMiddleWare.la libMiddleWare_la_SOURCES = MiddleWare.cpp MiddleWare.h PluginManager.cpp \ - PluginManager.h CrashCatcherPlugin.cpp \ - CrashCatcherPlugin.h DynamicLibrary.cpp \ + PluginManager.h ABRTPlugin.cpp \ + ABRTPlugin.h DynamicLibrary.cpp \ DynamicLibrary.h Settings.h Settings.cpp \ - RPMInfo.cpp RPMInfo.h Plugin.h CrashTypes.h \ + RPM.cpp RPM.h Plugin.h CrashTypes.h \ MiddleWareTypes.h Application.h Database.h \ Reporter.h Language.h libMiddleWare_la_LIBADD = $(DL_LIBS) ../Utils/libUtils.la $(RPM_LIBS) diff --git a/lib/MiddleWare/MiddleWare.cpp b/lib/MiddleWare/MiddleWare.cpp index 20ee48a9..4dcf664c 100644 --- a/lib/MiddleWare/MiddleWare.cpp +++ b/lib/MiddleWare/MiddleWare.cpp @@ -68,7 +68,7 @@ void CMiddleWare::LoadSettings(const std::string& pPath) set_opengpg_keys_t::iterator it_k; for (it_k = m_setOpenGPGKeys.begin(); it_k != m_setOpenGPGKeys.end(); it_k++) { - m_RPMInfo.LoadOpenGPGPublicKey(*it_k); + m_RPM.LoadOpenGPGPublicKey(*it_k); } } if (settings.find("EnableOpenGPG") != settings.end()) @@ -108,9 +108,15 @@ void CMiddleWare::DebugDump2Report(const std::string& pDebugDumpDir, crash_repor dd.LoadText(FILENAME_KERNEL, pCrashReport.m_sKernel); dd.LoadText(FILENAME_PACKAGE, pCrashReport.m_sPackage); dd.LoadText(FILENAME_EXECUTABLE, pCrashReport.m_sExecutable); - dd.LoadText(FILENAME_CMDLINE, pCrashReport.m_sCmdLine); - dd.LoadText(FILENAME_RELEASE, pCrashReport.m_sRelease); + if (dd.Exist(FILENAME_CMDLINE)) + { + dd.LoadText(FILENAME_CMDLINE, pCrashReport.m_sCmdLine); + } + if (dd.Exist(FILENAME_RELEASE)) + { + dd.LoadText(FILENAME_RELEASE, pCrashReport.m_sRelease); + } if (dd.Exist(FILENAME_TEXTDATA1)) { dd.LoadText(FILENAME_TEXTDATA1, pCrashReport.m_sTextData1); @@ -281,10 +287,16 @@ int CMiddleWare::SaveDebugDump(const std::string& pDebugDumpDir, crash_info_t& p dd.Open(pDebugDumpDir); dd.LoadText(FILENAME_EXECUTABLE, executable); - package = m_RPMInfo.GetPackage(executable, description); - if (executable != "kernel") + if (executable == "kernel") + { + package = "kernel"; + description = m_RPM.GetDescription(executable); + } + else { + package = m_RPM.GetPackage(executable); std::string packageName = package.substr(0, package.rfind("-", package.rfind("-") - 1)); + description = m_RPM.GetDescription(executable); if (packageName == "" || (m_setBlackList.find(packageName) != m_setBlackList.end())) { @@ -294,8 +306,8 @@ int CMiddleWare::SaveDebugDump(const std::string& pDebugDumpDir, crash_info_t& p } if (m_bOpenGPGCheck) { - if (!m_RPMInfo.CheckFingerprint(packageName) || - !m_RPMInfo.CheckHash(packageName, executable)) + if (!m_RPM.CheckFingerprint(packageName) || + !m_RPM.CheckHash(packageName, executable)) { dd.Delete(); dd.Close(); @@ -303,16 +315,6 @@ int CMiddleWare::SaveDebugDump(const std::string& pDebugDumpDir, crash_info_t& p } } } - else - { - package = "kernel"; - description = "The Linux kernel"; - description += "\n\n"; - description += "The kernel contains the Linux kernel (vmlinuz), the core of any" - "Linux operating system. The kernel handles the basic functions" - "of the operating system: memory allocation, process allocation, device" - "input and output, etc."; - } dd.SaveText(FILENAME_PACKAGE, package); dd.SaveText(FILENAME_DESCRIPTION, description); diff --git a/lib/MiddleWare/MiddleWare.h b/lib/MiddleWare/MiddleWare.h index a492257b..9de12d0f 100644 --- a/lib/MiddleWare/MiddleWare.h +++ b/lib/MiddleWare/MiddleWare.h @@ -27,7 +27,7 @@ #include "PluginManager.h" #include "CrashTypes.h" #include "MiddleWareTypes.h" -#include "RPMInfo.h" +#include "RPM.h" class CMiddleWare { @@ -39,7 +39,7 @@ class CMiddleWare typedef std::map<std::string, set_reporters_t> map_plugin2reporters_t; CPluginManager* m_pPluginManager; - CRPMInfo m_RPMInfo; + CRPM m_RPM; set_blacklist_t m_setBlackList; set_enabled_plugins_t m_setEnabledPlugins; set_opengpg_keys_t m_setOpenGPGKeys; diff --git a/lib/MiddleWare/PluginManager.cpp b/lib/MiddleWare/PluginManager.cpp index 08cd1136..7d8eb4ef 100644 --- a/lib/MiddleWare/PluginManager.cpp +++ b/lib/MiddleWare/PluginManager.cpp @@ -60,8 +60,8 @@ void CPluginManager::LoadPlugins() void CPluginManager::UnLoadPlugins() { - map_crash_catcher_plugins_t::iterator it_p; - while ((it_p = m_mapCrashCatcherPlugins.begin()) != m_mapCrashCatcherPlugins.end()) + map_abrt_plugins_t::iterator it_p; + while ((it_p = m_mapABRTPlugins.begin()) != m_mapABRTPlugins.end()) { std::string pluginName = it_p->first; UnLoadPlugin(pluginName); @@ -70,26 +70,26 @@ void CPluginManager::UnLoadPlugins() void CPluginManager::LoadPlugin(const std::string& pName) { - if (m_mapCrashCatcherPlugins.find(pName) == m_mapCrashCatcherPlugins.end()) + if (m_mapABRTPlugins.find(pName) == m_mapABRTPlugins.end()) { - CCrashCatcherPlugin* crashCatcherPlugin = NULL; + CABRTPlugin* abrtPlugin = NULL; try { std::string libPath = m_sPlugisLibDir + "/lib" + pName + "." + PLUGINS_LIB_EXTENSIONS; - crashCatcherPlugin = new CCrashCatcherPlugin(libPath); - if (crashCatcherPlugin->GetMagicNumber() != PLUGINS_MAGIC_NUMBER || - (crashCatcherPlugin->GetType() < LANGUAGE && crashCatcherPlugin->GetType() > DATABASE)) + abrtPlugin = new CABRTPlugin(libPath); + if (abrtPlugin->GetMagicNumber() != PLUGINS_MAGIC_NUMBER || + (abrtPlugin->GetType() < LANGUAGE && abrtPlugin->GetType() > DATABASE)) { throw std::string("non-compatible plugin"); } - std::cerr << "Plugin " << pName << " (" << crashCatcherPlugin->GetVersion() << ") " << "succesfully loaded." << std::endl; - m_mapCrashCatcherPlugins[pName] = crashCatcherPlugin; + std::cerr << "Plugin " << pName << " (" << abrtPlugin->GetVersion() << ") " << "succesfully loaded." << std::endl; + m_mapABRTPlugins[pName] = abrtPlugin; } catch (std::string sError) { - if (crashCatcherPlugin != NULL) + if (abrtPlugin != NULL) { - delete crashCatcherPlugin; + delete abrtPlugin; } std::cerr << "Failed to load plugin " << pName << " (" << sError << ")." << std::endl; } @@ -98,11 +98,11 @@ void CPluginManager::LoadPlugin(const std::string& pName) void CPluginManager::UnLoadPlugin(const std::string& pName) { - if (m_mapCrashCatcherPlugins.find(pName) != m_mapCrashCatcherPlugins.end()) + if (m_mapABRTPlugins.find(pName) != m_mapABRTPlugins.end()) { UnRegisterPlugin(pName); - delete m_mapCrashCatcherPlugins[pName]; - m_mapCrashCatcherPlugins.erase(pName); + delete m_mapABRTPlugins[pName]; + m_mapABRTPlugins.erase(pName); std::cerr << "Plugin " << pName << " sucessfully unloaded." << std::endl; } } @@ -110,19 +110,19 @@ void CPluginManager::UnLoadPlugin(const std::string& pName) void CPluginManager::RegisterPlugin(const std::string& pName) { - if (m_mapCrashCatcherPlugins.find(pName) != m_mapCrashCatcherPlugins.end()) + if (m_mapABRTPlugins.find(pName) != m_mapABRTPlugins.end()) { if (m_mapPlugins.find(pName) == m_mapPlugins.end()) { map_settings_t settings; std::string path = m_sPlugisConfDir + "/" + pName + "." + PLUGINS_CONF_EXTENSION; load_settings(path, settings); - CPlugin* plugin = m_mapCrashCatcherPlugins[pName]->PluginNew(); + CPlugin* plugin = m_mapABRTPlugins[pName]->PluginNew(); plugin->Init(); plugin->SetSettings(settings); m_mapPlugins[pName] = plugin; std::cerr << "Registred plugin " << pName << "(" - << plugin_type_str_t[m_mapCrashCatcherPlugins[pName]->GetType()] + << plugin_type_str_t[m_mapABRTPlugins[pName]->GetType()] << ")" << std::endl; } } @@ -130,7 +130,7 @@ void CPluginManager::RegisterPlugin(const std::string& pName) void CPluginManager::UnRegisterPlugin(const std::string& pName) { - if (m_mapCrashCatcherPlugins.find(pName) != m_mapCrashCatcherPlugins.end()) + if (m_mapABRTPlugins.find(pName) != m_mapABRTPlugins.end()) { if (m_mapPlugins.find(pName) != m_mapPlugins.end()) { @@ -138,7 +138,7 @@ void CPluginManager::UnRegisterPlugin(const std::string& pName) delete m_mapPlugins[pName]; m_mapPlugins.erase(pName); std::cerr << "UnRegistred plugin " << pName << "(" - << plugin_type_str_t[m_mapCrashCatcherPlugins[pName]->GetType()] + << plugin_type_str_t[m_mapABRTPlugins[pName]->GetType()] << ")" << std::endl; } } diff --git a/lib/MiddleWare/PluginManager.h b/lib/MiddleWare/PluginManager.h index c064c0c2..9f5979a1 100644 --- a/lib/MiddleWare/PluginManager.h +++ b/lib/MiddleWare/PluginManager.h @@ -25,7 +25,7 @@ #include <map> #include <string> -#include "CrashCatcherPlugin.h" +#include "ABRTPlugin.h" #include "Plugin.h" #include "Language.h" #include "Reporter.h" @@ -35,11 +35,11 @@ class CPluginManager { private: - typedef std::map<std::string, CCrashCatcherPlugin*> map_crash_catcher_plugins_t; + typedef std::map<std::string, CABRTPlugin*> map_abrt_plugins_t; typedef std::map<std::string, CPlugin*> map_plugins_t; - map_crash_catcher_plugins_t m_mapCrashCatcherPlugins; + map_abrt_plugins_t m_mapABRTPlugins; map_plugins_t m_mapPlugins; std::string m_sPlugisConfDir; diff --git a/lib/MiddleWare/RPMInfo.cpp b/lib/MiddleWare/RPM.cpp index 971148b4..409959e4 100644 --- a/lib/MiddleWare/RPMInfo.cpp +++ b/lib/MiddleWare/RPM.cpp @@ -1,18 +1,18 @@ -#include "RPMInfo.h" +#include "RPM.h" #include <iostream> -CRPMInfo::CRPMInfo() +CRPM::CRPM() { char *argv[] = {(char*)""}; m_poptContext = rpmcliInit(0, argv, NULL); } -CRPMInfo::~CRPMInfo() +CRPM::~CRPM() { rpmcliFini(m_poptContext); } -void CRPMInfo::LoadOpenGPGPublicKey(const std::string& pFileName) +void CRPM::LoadOpenGPGPublicKey(const std::string& pFileName) { uint8_t* pkt = NULL; size_t pklen; @@ -20,7 +20,7 @@ void CRPMInfo::LoadOpenGPGPublicKey(const std::string& pFileName) if (pgpReadPkts(pFileName.c_str(), &pkt, &pklen) != PGPARMOR_PUBKEY) { free(pkt); - std::cerr << "CRPMInfo::LoadOpenGPGPublicKey(): Can not load public key " + pFileName << std::endl; + std::cerr << "CRPM::LoadOpenGPGPublicKey(): Can not load public key " + pFileName << std::endl; return; } if (pgpPubkeyFingerprint(pkt, pklen, keyID) == 0) @@ -34,7 +34,7 @@ void CRPMInfo::LoadOpenGPGPublicKey(const std::string& pFileName) free(pkt); } -bool CRPMInfo::CheckFingerprint(const std::string& pPackage) +bool CRPM::CheckFingerprint(const std::string& pPackage) { bool ret = false; rpmts ts = rpmtsCreate(); @@ -64,7 +64,7 @@ bool CRPMInfo::CheckFingerprint(const std::string& pPackage) return ret; } -bool CRPMInfo::CheckHash(const std::string& pPackage, const std::string& pPath) +bool CRPM::CheckHash(const std::string& pPackage, const std::string& pPath) { bool ret = false; rpmts ts = rpmtsCreate(); @@ -98,7 +98,29 @@ bool CRPMInfo::CheckHash(const std::string& pPackage, const std::string& pPath) return ret; } -std::string CRPMInfo::GetPackage(const std::string& pFileName, std::string& pDescription) +std::string CRPM::GetDescription(const std::string& pPackage) +{ + std::string pDescription = ""; + rpmts ts = rpmtsCreate(); + rpmdbMatchIterator iter = rpmtsInitIterator(ts, RPMTAG_NAME, pPackage.c_str(), 0); + Header header; + if ((header = rpmdbNextIterator(iter)) != NULL) + { + rpmtd td = rpmtdNew(); + headerGet(header, RPMTAG_SUMMARY, td, HEADERGET_DEFAULT); + const char* summary = rpmtdGetString(td); + headerGet(header, RPMTAG_DESCRIPTION, td, HEADERGET_DEFAULT); + const char* description = rpmtdGetString(td); + pDescription = summary + std::string("\n\n") + description; + rpmtdFree(td); + + } + rpmdbFreeIterator(iter); + rpmtsFree(ts); + return pDescription; +} + +std::string CRPM::GetPackage(const std::string& pFileName) { std::string ret = ""; rpmts ts = rpmtsCreate(); @@ -112,13 +134,6 @@ std::string CRPMInfo::GetPackage(const std::string& pFileName, std::string& pDes ret = nerv; free(nerv); } - rpmtd td = rpmtdNew(); - headerGet(header, RPMTAG_SUMMARY, td, HEADERGET_DEFAULT); - const char* summary = rpmtdGetString(td); - headerGet(header, RPMTAG_DESCRIPTION, td, HEADERGET_DEFAULT); - const char* description = rpmtdGetString(td); - pDescription = summary + std::string("\n\n") + description; - rpmtdFree(td); } rpmdbFreeIterator(iter); diff --git a/lib/MiddleWare/RPMInfo.h b/lib/MiddleWare/RPM.h index f2d00aac..00196f7e 100644 --- a/lib/MiddleWare/RPMInfo.h +++ b/lib/MiddleWare/RPM.h @@ -29,7 +29,7 @@ #include <rpm/rpmts.h> #include <rpm/rpmdb.h> -class CRPMInfo +class CRPM { private: @@ -39,14 +39,15 @@ class CRPMInfo set_fingerprints_t m_setFingerprints; public: - CRPMInfo(); - ~CRPMInfo(); + CRPM(); + ~CRPM(); void LoadOpenGPGPublicKey(const std::string& pFileName); bool CheckFingerprint(const std::string& pPackage); bool CheckHash(const std::string& pPackage, const std::string&pPath); - std::string GetPackage(const std::string& pFileName, std::string& pDescription); + std::string GetDescription(const std::string& pPackage); + std::string GetPackage(const std::string& pFileName); }; #endif /* RPMINFO_H_ */ diff --git a/lib/MiddleWare/Settings.cpp b/lib/MiddleWare/Settings.cpp index 92e22eab..65b7f16c 100644 --- a/lib/MiddleWare/Settings.cpp +++ b/lib/MiddleWare/Settings.cpp @@ -85,7 +85,7 @@ void save_settings(const std::string& path, const map_settings_t& settings) fOut.open(path.c_str()); if (fOut.is_open()) { - fOut << "# !DO NOT EDIT THIS FILE BY HAND. IT IS GENERATED BY CRASHCATCHER!" << std::endl; + fOut << "# !DO NOT EDIT THIS FILE BY HAND. IT IS GENERATED BY ABRT!" << std::endl; for (it = settings.begin(); it != settings.end(); it++) { fOut << it->first << " = " << it->second << std::endl << std::endl; diff --git a/lib/MiddleWare/test.cpp b/lib/MiddleWare/test.cpp index e21da3a2..e5c9b38a 100644 --- a/lib/MiddleWare/test.cpp +++ b/lib/MiddleWare/test.cpp @@ -35,7 +35,7 @@ int main(int argc, char** argv) { CMiddleWare middleWare(PLUGINS_CONF_DIR, PLUGINS_LIB_DIR, - std::string(CONF_DIR) + "/crash-catcher.conf"); + std::string(CONF_DIR) + "/abrt.conf"); /* Create DebugDump */ CDebugDump dd; char pid[100]; diff --git a/lib/Plugins/Logger.conf b/lib/Plugins/Logger.conf index 75be729f..901b3cf5 100644 --- a/lib/Plugins/Logger.conf +++ b/lib/Plugins/Logger.conf @@ -1,5 +1,5 @@ # Configuration for Logger plugin -LogPath = /var/log/crash-catcher-logger +LogPath = /var/log/abrt-logger AppendLogs = yes
\ No newline at end of file diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp index 0f0922f7..c1cb6311 100644 --- a/lib/Plugins/Mailx.cpp +++ b/lib/Plugins/Mailx.cpp @@ -25,7 +25,7 @@ #include "DebugDump.h" #define MAILX_COMMAND "/bin/mailx" -#define MAILX_SUBJECT "\"CrashCatcher automated bug report\"" +#define MAILX_SUBJECT "\"abrt automated bug report\"" CMailx::CMailx() : m_sEmailFrom("user@localhost"), diff --git a/lib/Plugins/SQLite3.cpp b/lib/Plugins/SQLite3.cpp index 78dd5b2f..645287ba 100644 --- a/lib/Plugins/SQLite3.cpp +++ b/lib/Plugins/SQLite3.cpp @@ -26,10 +26,10 @@ #include <iostream> -#define TABLE_NAME "crash_catcher" +#define TABLE_NAME "abrt" CSQLite3::CSQLite3() : - m_sDBPath("/tmp/CCDB"), + m_sDBPath("/var/cache/abrt/abrt-db"), m_pDB(NULL) {} diff --git a/src/Applet/Makefile.am b/src/Applet/Makefile.am index 8e743d5e..1bdb5519 100644 --- a/src/Applet/Makefile.am +++ b/src/Applet/Makefile.am @@ -1,8 +1,8 @@ -bin_PROGRAMS = cc-applet -cc_applet_SOURCES = Applet.cpp CCApplet.cpp CCApplet.h DBusClientProxy.h -cc_applet_CPPFLAGS = -Wall -Werror -I../Daemon/ \ - -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ - $(DBUS_GLIB_CFLAGS) $(GTK_CFLAGS) $(DBUSCPP_CFLAGS) \ - -I../../lib/MiddleWare -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include +bin_PROGRAMS = abrt-applet +abrt_applet_SOURCES = Applet.cpp CCApplet.cpp CCApplet.h DBusClientProxy.h +abrt_applet_CPPFLAGS = -Wall -Werror -I../Daemon/ \ + -DDEBUG_DUMPS_DIR=\"$(DEBUG_DUMPS_DIR)\" \ + $(DBUS_GLIB_CFLAGS) $(GTK_CFLAGS) $(DBUSCPP_CFLAGS) \ + -I../../lib/MiddleWare -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -cc_applet_LDADD = $(DL_LIBS) $(GTK_LIBS) -lglib-2.0 -lgthread-2.0 $(DBUSCPP_LIBS) +abrt_applet_LDADD = $(DL_LIBS) $(GTK_LIBS) -lglib-2.0 -lgthread-2.0 $(DBUSCPP_LIBS) diff --git a/src/Daemon/CrashWatcher.cpp b/src/Daemon/CrashWatcher.cpp index 114400c0..cc0960a8 100644 --- a/src/Daemon/CrashWatcher.cpp +++ b/src/Daemon/CrashWatcher.cpp @@ -1,22 +1,22 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - 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. +/* + Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) + 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 "CrashWatcher.h" #include <unistd.h> #include <iostream> @@ -62,7 +62,7 @@ gboolean CCrashWatcher::handle_event_cb(GIOChannel *gio, GIOCondition condition, #ifdef DEBUG std::cout << "Created file: " << name << std::endl; #endif /*DEBUG*/ - + /* we want to ignore the lock files */ if(event->mask & IN_ISDIR) { @@ -109,7 +109,7 @@ CCrashWatcher::CCrashWatcher(const std::string& pPath,DBus::Connection &connecti exit(-1); } if((watch = inotify_add_watch(m_nFd, pPath.c_str(), IN_CREATE)) == -1){ - + throw std::string("Add watch failed:") + pPath.c_str(); } m_pGio = g_io_channel_unix_new(m_nFd); @@ -126,7 +126,7 @@ CCrashWatcher::~CCrashWatcher() dbus_vector_crash_infos_t CCrashWatcher::GetCrashInfos(const std::string &pUID) { dbus_vector_crash_infos_t retval; - vector_crash_infos_t crash_info; + vector_crash_infos_t crash_info; m_pMW->GetCrashInfos("501"); for (vector_crash_infos_t::iterator it = crash_info.begin(); it!=crash_info.end(); ++it) { std::cerr << it->m_sExecutable << std::endl; @@ -214,8 +214,8 @@ bool CCrashWatcher::DeleteDebugDump(const std::string& pUUID, const std::string& } void CCrashWatcher::Lock() { - int lfp = open("crashcatcher.lock",O_RDWR|O_CREAT,0640); - if (lfp < 0) + int lfp = open("abrt.lock",O_RDWR|O_CREAT,0640); + if (lfp < 0) throw std::string("CCrashWatcher.cpp:can not open lock file"); if (lockf(lfp,F_TLOCK,0) < 0) throw std::string("CCrashWatcher.cpp:Lock:cannot create lock on lockfile"); @@ -237,7 +237,7 @@ void CCrashWatcher::StartWatch() len = read(m_nFd,buff,INOTIFY_BUFF_SIZE); while(i < len){ pevent = (struct inotify_event *)&buff[i]; - if (pevent->len) + if (pevent->len) std::strcpy(action, pevent->name); else std::strcpy(action, m_sTarget.c_str()); diff --git a/src/Daemon/DBusCommon.h b/src/Daemon/DBusCommon.h index 1e26e392..7582541c 100644 --- a/src/Daemon/DBusCommon.h +++ b/src/Daemon/DBusCommon.h @@ -17,9 +17,9 @@ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define CC_DBUS_NAME "com.redhat.crash_catcher" -#define CC_DBUS_PATH "/com/redhat/crash_catcher" -#define CC_DBUS_IFACE "com.redhat.crash_catcher" +#define CC_DBUS_NAME "com.redhat.abrt" +#define CC_DBUS_PATH "/com/redhat/abrt" +#define CC_DBUS_IFACE "com.redhat.abrt" //typedef std::vector<crash_info_t> vector_crash_infos_t; typedef std::vector< std::vector<std::string> > dbus_vector_crash_infos_t; diff --git a/src/Daemon/DBusServerProxy.h b/src/Daemon/DBusServerProxy.h index 6a76f2c6..e844f0fd 100644 --- a/src/Daemon/DBusServerProxy.h +++ b/src/Daemon/DBusServerProxy.h @@ -1,20 +1,20 @@ -/* - Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) - 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. +/* + Copyright (C) 2009 Jiri Moskovcak (jmoskovc@redhat.com) + 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 <dbus-c++/dbus.h> @@ -37,7 +37,7 @@ public: } /* reveal Interface introspection when we stabilize the API */ /* - DBus::IntrospectedInterface *const introspect() const + DBus::IntrospectedInterface *const introspect() const { static DBus::IntrospectedArgument GetCrashInfos_args[] = { @@ -45,30 +45,30 @@ public: { "info", "a{ss}", false }, { 0, 0, 0 } }; - static DBus::IntrospectedArgument Crash_args[] = + static DBus::IntrospectedArgument Crash_args[] = { { "package", "s", false }, { 0, 0, 0 } }; - static DBus::IntrospectedMethod CDBusServer_adaptor_methods[] = + static DBus::IntrospectedMethod CDBusServer_adaptor_methods[] = { { "GetCrashInfos", GetCrashInfos_args }, { 0, 0 }, { "GetCrashInfosMap", GetCrashInfos_args }, { 0, 0 } }; - static DBus::IntrospectedMethod CDBusServer_adaptor_signals[] = + static DBus::IntrospectedMethod CDBusServer_adaptor_signals[] = { { "Crash", Crash_args }, { 0, 0 } }; - static DBus::IntrospectedProperty CDBusServer_adaptor_properties[] = + static DBus::IntrospectedProperty CDBusServer_adaptor_properties[] = { { 0, 0, 0, 0 } }; - static DBus::IntrospectedInterface CDBusServer_adaptor_interface = + static DBus::IntrospectedInterface CDBusServer_adaptor_interface = { - "com.redhat.CrashCatcher", + "com.redhat.abrt", CDBusServer_adaptor_methods, CDBusServer_adaptor_signals, CDBusServer_adaptor_properties @@ -113,8 +113,8 @@ public: wi << arg1; emit_signal(sig); } - - + + private: /* unmarshalers (to unpack the DBus message before calling the actual interface method) @@ -122,7 +122,7 @@ private: DBus::Message _GetCrashInfos_stub(const DBus::CallMessage &call) { DBus::MessageIter ri = call.reader(); - + std::string argin1; ri >> argin1; dbus_vector_crash_infos_t argout1 = GetCrashInfos(argin1); DBus::ReturnMessage reply(call); @@ -130,11 +130,11 @@ private: wi << argout1; return reply; } - + DBus::Message _CreateReport_stub(const DBus::CallMessage &call) { DBus::MessageIter ri = call.reader(); - + std::string argin1; ri >> argin1; dbus_map_report_info_t argout1 = CreateReport(argin1,call.sender()); DBus::ReturnMessage reply(call); @@ -142,11 +142,11 @@ private: wi << argout1; return reply; } - + DBus::Message _GetCrashInfosMap_stub(const DBus::CallMessage &call) { DBus::MessageIter ri = call.reader(); - + //std::string argin1; ri >> argin1; dbus_vector_map_crash_infos_t argout1 = GetCrashInfosMap(call.sender()); DBus::ReturnMessage reply(call); @@ -154,11 +154,11 @@ private: wi << argout1; return reply; } - + DBus::Message _Report_stub(const DBus::CallMessage &call) { DBus::MessageIter ri = call.reader(); - + dbus_map_report_info_t argin1; ri >> argin1; bool argout1 = Report(argin1); DBus::ReturnMessage reply(call); @@ -166,11 +166,11 @@ private: wi << argout1; return reply; } - + DBus::Message _DeleteDebugDump_stub(const DBus::CallMessage &call) { DBus::MessageIter ri = call.reader(); - + std::string argin1; ri >> argin1; bool argout1 = DeleteDebugDump(argin1,call.sender()); DBus::ReturnMessage reply(call); diff --git a/src/Daemon/dbus-abrt.conf b/src/Daemon/dbus-abrt.conf index 75c9a6d0..11b2a111 100644 --- a/src/Daemon/dbus-abrt.conf +++ b/src/Daemon/dbus-abrt.conf @@ -1,5 +1,5 @@ <!-- This configuration file specifies the required security policies - for CrashCatcher core daemon to work. --> + for abrt core daemon to work. --> <!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> @@ -8,18 +8,18 @@ <!-- ../system.conf have denied everything, so we just punch some holes --> <policy user="root"> - <allow own="com.redhat.crash_catcher"/> - <allow send_destination="com.redhat.crash_catcher"/> - <allow send_interface="com.redhat.crash_catcher"/> + <allow own="com.redhat.abrt"/> + <allow send_destination="com.redhat.abrt"/> + <allow send_interface="com.redhat.abrt"/> </policy> <policy at_console="true"> - <allow send_destination="com.redhat.crash_catcher"/> + <allow send_destination="com.redhat.abrt"/> </policy> - <!-- Allow anyone to invoke methods on crash-catcher server --> + <!-- Allow anyone to invoke methods on abrt server --> <policy context="default"> - <allow send_destination="com.redhat.crash_catcher"/> + <allow send_destination="com.redhat.abrt"/> </policy> </busconfig> diff --git a/src/Gui/CCDBusBackend.py b/src/Gui/CCDBusBackend.py index 7d9f0c49..0cc26d59 100644 --- a/src/Gui/CCDBusBackend.py +++ b/src/Gui/CCDBusBackend.py @@ -3,8 +3,8 @@ import gobject from dbus.mainloop.glib import DBusGMainLoop import gtk -CC_IFACE = 'com.redhat.crash_catcher' -CC_PATH = '/com/redhat/crash_catcher' +CC_IFACE = 'com.redhat.abrt' +CC_PATH = '/com/redhat/abrt' class DBusManager(gobject.GObject): @@ -60,7 +60,7 @@ class DBusManager(gobject.GObject): try: self.proxy = bus.get_object(CC_IFACE, CC_PATH) except Exception, e: - raise Exception(e.message + "\nPlease check if crash-catcher daemon is running.") + raise Exception(e.message + "\nPlease check if abrt daemon is running.") def getReport(self, UUID): try: diff --git a/src/Hooks/CCpp.cpp b/src/Hooks/CCpp.cpp index 2d0a1c5d..4a529437 100644 --- a/src/Hooks/CCpp.cpp +++ b/src/Hooks/CCpp.cpp @@ -34,7 +34,7 @@ static void write_log(const char* pid) { - openlog("crash-catcher", 0, LOG_DAEMON); + openlog("abrt", 0, LOG_DAEMON); syslog(LOG_WARNING, "CCpp Language Hook: Crashed pid: %s", pid); closelog(); } |