From 3661fe306cd3cb52f823bcf310eda5727e23884f Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 26 Feb 2009 15:52:47 +0100 Subject: fixed typo --- lib/MiddleWare/RPMInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MiddleWare/RPMInfo.cpp b/lib/MiddleWare/RPMInfo.cpp index 64f0628..971148b 100644 --- a/lib/MiddleWare/RPMInfo.cpp +++ b/lib/MiddleWare/RPMInfo.cpp @@ -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 publick key " + pFileName << std::endl; + std::cerr << "CRPMInfo::LoadOpenGPGPublicKey(): Can not load public key " + pFileName << std::endl; return; } if (pgpPubkeyFingerprint(pkt, pklen, keyID) == 0) -- cgit From e5d5445e1dd8161cf818d96aea30e51fee846231 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 26 Feb 2009 15:53:02 +0100 Subject: added new line --- lib/MiddleWare/crash-catcher.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/MiddleWare/crash-catcher.conf b/lib/MiddleWare/crash-catcher.conf index 9421cd4..94743a1 100644 --- a/lib/MiddleWare/crash-catcher.conf +++ b/lib/MiddleWare/crash-catcher.conf @@ -10,4 +10,4 @@ EnabledPlugins = SQLite3, CCpp, Mailx # selected DB plugin Database = SQLite3 # reporters association -CCpp = Mailx \ No newline at end of file +CCpp = Mailx -- cgit From c9d12659371287fd9893e5492fedb8912a974238 Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 26 Feb 2009 15:53:19 +0100 Subject: added new option --- lib/Plugins/Mailx.conf | 3 +++ lib/Plugins/Mailx.cpp | 22 +++++++++++++++------- lib/Plugins/Mailx.h | 1 + 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/lib/Plugins/Mailx.conf b/lib/Plugins/Mailx.conf index bfbbff8..c1bddff 100644 --- a/lib/Plugins/Mailx.conf +++ b/lib/Plugins/Mailx.conf @@ -7,3 +7,6 @@ EmailFrom = user@localhost # Email To EmailTo = root@localhost + +# Warning! enabling this may cause sending a lot of MB via email +SendBinaryData = no diff --git a/lib/Plugins/Mailx.cpp b/lib/Plugins/Mailx.cpp index a320d3e..0f0922f 100644 --- a/lib/Plugins/Mailx.cpp +++ b/lib/Plugins/Mailx.cpp @@ -31,7 +31,8 @@ CMailx::CMailx() : m_sEmailFrom("user@localhost"), m_sEmailTo("root@localhost"), m_sParameters(""), - m_sAttachments("") + m_sAttachments(""), + m_bSendBinaryData(false) {} @@ -102,13 +103,16 @@ void CMailx::Report(const crash_report_t& pReport) ss << "==============" << std::endl; ss << "See the attachment[s]" << std::endl; - if (pReport.m_sBinaryData1 != "") + if (m_bSendBinaryData) { - m_sAttachments = " -a " + pReport.m_sBinaryData1; - } - if (pReport.m_sBinaryData2 != "") - { - m_sAttachments = " -a " + pReport.m_sBinaryData2; + if (pReport.m_sBinaryData1 != "") + { + m_sAttachments = " -a " + pReport.m_sBinaryData1; + } + if (pReport.m_sBinaryData2 != "") + { + m_sAttachments = " -a " + pReport.m_sBinaryData2; + } } SendEmail(ss.str()); @@ -128,4 +132,8 @@ void CMailx::SetSettings(const map_settings_t& pSettings) { m_sParameters = pSettings.find("Parameters")->second; } + if (pSettings.find("SendBinaryData")!= pSettings.end()) + { + m_bSendBinaryData = pSettings.find("SendBinaryData")->second == "yes"; + } } diff --git a/lib/Plugins/Mailx.h b/lib/Plugins/Mailx.h index ab317eb..1a64414 100644 --- a/lib/Plugins/Mailx.h +++ b/lib/Plugins/Mailx.h @@ -34,6 +34,7 @@ class CMailx : public CReporter std::string m_sEmailTo; std::string m_sParameters; std::string m_sAttachments; + bool m_bSendBinaryData; void SendEmail(const std::string& pText); -- cgit From 60d9b1f8cc6189e7d3473166aac29bbab2dd6b3e Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 26 Feb 2009 16:25:21 +0100 Subject: fixed typo --- lib/Utils/DebugDump.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Utils/DebugDump.h b/lib/Utils/DebugDump.h index f48d8e4..32e0396 100644 --- a/lib/Utils/DebugDump.h +++ b/lib/Utils/DebugDump.h @@ -34,7 +34,7 @@ #define FILENAME_TIME "time" #define FILENAME_UID "uid" #define FILENAME_PACKAGE "package" -#define FILENAME_DESCRIPTION "decsription" +#define FILENAME_DESCRIPTION "description" #define FILENAME_LANGUAGE "language" #define FILENAME_APPLICATION "application" #define FILENAME_TEXTDATA1 "text_data1" -- cgit From db760442ecdbf776648fbd19aa32083722e5b10f Mon Sep 17 00:00:00 2001 From: Zdenek Prikryl Date: Thu, 26 Feb 2009 16:27:55 +0100 Subject: removed debug stuff --- lib/MiddleWare/MiddleWare.cpp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/lib/MiddleWare/MiddleWare.cpp b/lib/MiddleWare/MiddleWare.cpp index d60e645..161b1f8 100644 --- a/lib/MiddleWare/MiddleWare.cpp +++ b/lib/MiddleWare/MiddleWare.cpp @@ -183,13 +183,10 @@ void CMiddleWare::CreateReportApplication(const std::string& pApplication, return application->CreateReport(pDebugDumpDir); } -#include -#include void CMiddleWare::CreateReport(const std::string& pUUID, const std::string& pUID, crash_report_t& pCrashReport) { - std::cout << "CMiddleWare::CreateReport() s" << std::endl; CDatabase* database = m_pPluginManager->GetDatabase(m_sDatabase); database_row_t row; database->Connect(); @@ -219,27 +216,14 @@ void CMiddleWare::CreateReport(const std::string& pUUID, } dd.SaveText(FILENAME_UUID, UUID); dd.Close(); - fflush(stdout); - fflush(stderr); - std::cerr << "CMiddleWare::CreateReport() e1" << std::endl; - fflush(stdout); - fflush(stderr); DebugDump2Report(row.m_sDebugDumpDir, pCrashReport); - fflush(stdout); - fflush(stderr); - std::cerr << "CMiddleWare::CreateReport() e2" << std::endl; pCrashReport.m_sMWID = appLan + ";" + pUID + ";" + pUUID ; - fflush(stdout); - fflush(stderr); - - std::cerr << "CMiddleWare::CreateReport() e3" << std::endl; } void CMiddleWare::Report(const crash_report_t& pCrashReport) { - std::cout << "CMiddleWare::Report() s" << std::endl; std::string::size_type pos1 = 0; std::string::size_type pos2 = pCrashReport.m_sMWID.find(";", pos1); std::string lanAppPlugin = pCrashReport.m_sMWID.substr(pos1, pos2); @@ -265,7 +249,6 @@ void CMiddleWare::Report(const crash_report_t& pCrashReport) reporter->Report(pCrashReport); } } - std::cout << "CMiddleWare::Report() e" << std::endl; } void CMiddleWare::DeleteDebugDump(const std::string& pUUID, -- cgit