From 0db8836cb63f60799ac7b4c5222ba9e12ca5659c Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Thu, 26 Nov 2009 12:04:13 +0100 Subject: hookCCpp: check total dump dir size and delete the largest/oldest one Signed-off-by: Denys Vlasenko --- src/Daemon/MiddleWare.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'src/Daemon/MiddleWare.cpp') diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index f3c6bdf4..0a3fb9ad 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -520,13 +520,6 @@ report_status_t Report(const map_crash_report_t& pCrashReport, return ret; } -void DeleteDebugDumpDir(const char *pDebugDumpDir) -{ - CDebugDump dd; - dd.Open(pDebugDumpDir); - dd.Delete(); -} - std::string DeleteCrashInfo(const char *pUUID, const char *pUID) { -- cgit From 97311fe0f6970b9c791a872d6bd43c390d54859f Mon Sep 17 00:00:00 2001 From: Nikola Pajkovsky Date: Thu, 26 Nov 2009 19:07:05 +0100 Subject: Kerneloops are reported automaticky now when AutoReportUIDs = root is in Kerneloops.conf Signed-off-by: Nikola Pajkovsky --- src/Daemon/MiddleWare.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'src/Daemon/MiddleWare.cpp') diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp index 0a3fb9ad..69d36bfc 100644 --- a/src/Daemon/MiddleWare.cpp +++ b/src/Daemon/MiddleWare.cpp @@ -654,6 +654,55 @@ bool analyzer_has_InformAllUsers(const char *analyzer_name) return string_to_bool(it->second.c_str()); } +bool analyzer_has_AutoReportUIDs(const char *analyzer_name, const char* uid) +{ + CAnalyzer* analyzer = g_pPluginManager->GetAnalyzer(analyzer_name); + if (!analyzer) + { + VERB1 log("Strange, asked for analyzer %s but it doesn't exist?", analyzer_name); + return false; + } + map_plugin_settings_t settings = analyzer->GetSettings(); + map_plugin_settings_t::const_iterator it = settings.find("AutoReportUIDs"); + if (it == settings.end()) + return false; + + vector_string_t logins; + parse_args(it->second.c_str(), logins); + + uint32_t size = logins.size(); + if (size == 0) + return false; + + if ((strcmp(analyzer_name, "Kerneloops") == 0) && (strcmp(uid, "-1") == 0)) + return true; + + uid_t id; + for (uint32_t ii = 0; ii < size; ii++) + { + if (!xgetpwnam(logins[ii].c_str(), &id)) + continue; + + if (strcmp(uid, to_string(id).c_str()) == 0) + return true; + } + + return false; +} + +void autoreport(const pair_string_string_t& reporter_options, const map_crash_report_t& crash_report) +{ + CReporter* reporter = g_pPluginManager->GetReporter(reporter_options.first.c_str()); + if (!reporter) + { + VERB1 log("Strange, asked for reporter %s but it doesn't exist?", reporter_options.first.c_str()); + return; + } + + map_plugin_settings_t plugin_settings; + std::string res = reporter->Report(crash_report, plugin_settings, reporter_options.second); +} + /** * Execute all action plugins, which are associated to * particular analyzer plugin. -- cgit