summaryrefslogtreecommitdiffstats
path: root/src/Daemon/MiddleWare.cpp
diff options
context:
space:
mode:
authorKarel Klic <kklic@redhat.com>2009-11-30 15:07:45 +0100
committerKarel Klic <kklic@redhat.com>2009-11-30 15:07:45 +0100
commitc6fef68305a7bc2df55afc4d682317a05a8dfe97 (patch)
tree0332579a85acd6530b8b9dcbf29dc56187b565ea /src/Daemon/MiddleWare.cpp
parentf58611ea5957462e6be40950684a56579a2459a6 (diff)
parentf0bd70b3f68835983a10052337fc316a9f861811 (diff)
downloadabrt-c6fef68305a7bc2df55afc4d682317a05a8dfe97.tar.gz
abrt-c6fef68305a7bc2df55afc4d682317a05a8dfe97.tar.xz
abrt-c6fef68305a7bc2df55afc4d682317a05a8dfe97.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/abrt
Diffstat (limited to 'src/Daemon/MiddleWare.cpp')
-rw-r--r--src/Daemon/MiddleWare.cpp56
1 files changed, 49 insertions, 7 deletions
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp
index f3c6bdf..69d36bf 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)
{
@@ -661,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.