summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJiri Moskovcak <Mozkum@dhcp-lab-216.englab.brq.redhat.com>2009-11-01 23:25:19 +0100
committerJiri Moskovcak <Mozkum@dhcp-lab-216.englab.brq.redhat.com>2009-11-01 23:25:19 +0100
commit0586639caf9fd8218257a16006bb9783ee490102 (patch)
treea4b8bc367598338161cf0ad85dcd21d8ecd91b52 /src
parent675f8db1c51c474db89e988c06ace1b13f99857d (diff)
downloadabrt-0586639caf9fd8218257a16006bb9783ee490102.tar.gz
abrt-0586639caf9fd8218257a16006bb9783ee490102.tar.xz
abrt-0586639caf9fd8218257a16006bb9783ee490102.zip
Hack to fix the problem with daemon remembering the last used settings
Diffstat (limited to 'src')
-rw-r--r--src/Daemon/CommLayerServerDBus.cpp15
-rw-r--r--src/Daemon/CommLayerServerSocket.cpp11
-rw-r--r--src/Daemon/MiddleWare.cpp9
-rw-r--r--src/Daemon/MiddleWare.h1
4 files changed, 25 insertions, 11 deletions
diff --git a/src/Daemon/CommLayerServerDBus.cpp b/src/Daemon/CommLayerServerDBus.cpp
index cc98fc2c..dd904e4f 100644
--- a/src/Daemon/CommLayerServerDBus.cpp
+++ b/src/Daemon/CommLayerServerDBus.cpp
@@ -250,12 +250,10 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply)
if (!user_conf_data.empty())
{
std::string PluginName;
- map_plugin_settings_t plugin_settings;
map_map_string_t::const_iterator it_user_conf_data = user_conf_data.begin();
for (; it_user_conf_data != user_conf_data.end(); it_user_conf_data++)
{
PluginName = it_user_conf_data->first;
- plugin_settings = it_user_conf_data->second;
#if DEBUG
std::cout << "plugin name: " << it_user_conf_data->first;
map_string_t::const_iterator it_plugin_config;
@@ -266,16 +264,16 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply)
std::cout << " key: " << it_plugin_config->first << " value: " << it_plugin_config->second << std::endl;
}
#endif
- g_pPluginManager->SetPluginSettings(PluginName, sender, plugin_settings);
+ // this would overwrite the default settings
+ //g_pPluginManager->SetPluginSettings(PluginName, sender, plugin_settings);
}
}
-//so far, user_conf_data is unused
long unix_uid = get_remote_uid(call);
report_status_t argout1;
try
{
- argout1 = Report(argin1, to_string(unix_uid));
+ argout1 = Report(argin1, user_conf_data, to_string(unix_uid));
}
catch (CABRTException &e)
{
@@ -377,7 +375,12 @@ static int handle_SetPluginSettings(DBusMessage* call, DBusMessage* reply)
long unix_uid = get_remote_uid(call);
VERB1 log("got %s('%s',...) call from uid %ld", "SetPluginSettings", PluginName.c_str(), unix_uid);
- g_pPluginManager->SetPluginSettings(PluginName, to_string(unix_uid), plugin_settings);
+ /* Disabled, as we don't use it, we use only temporary user settings while reporting
+ this method should be used to change the default setting and thus should
+ be protected by polkit
+ */
+ //FIXME: protect with polkit
+// g_pPluginManager->SetPluginSettings(PluginName, to_string(unix_uid), plugin_settings);
send_flush_and_unref(reply);
return 0;
diff --git a/src/Daemon/CommLayerServerSocket.cpp b/src/Daemon/CommLayerServerSocket.cpp
index 6b62928b..7afe4b6e 100644
--- a/src/Daemon/CommLayerServerSocket.cpp
+++ b/src/Daemon/CommLayerServerSocket.cpp
@@ -138,7 +138,9 @@ void CCommLayerServerSocket::ProcessMessage(const std::string& pMessage, GIOChan
{
std::string message = pMessage.substr(sizeof(MESSAGE_REPORT) - 1);
map_crash_report_t report = string_to_crash_report(message);
- Report(report, UID);
+ map_plugin_settings_t plugin_settings;
+ //FIXME: another hack to make this compile
+// Report(report, plugin_settings, UID);
}
else if (!strncmp(pMessage.c_str(), MESSAGE_CREATE_REPORT, sizeof(MESSAGE_CREATE_REPORT) - 1))
{
@@ -227,7 +229,12 @@ vector_crash_infos_t CCommLayerServerSocket::GetCrashInfos(const std::string &pS
report_status_t CCommLayerServerSocket::Report(const map_crash_report_t& pReport, const std::string& pSender)
{
report_status_t rs;
- rs = ::Report(pReport, pSender);
+ //FIXME: a hack to make this compile, but we don't use sockets anyway
+ /* we could probably remove the sockets and rely only on dbus,
+ as it will become mandatory even on servers, but this needs some investigation
+ and more opinions
+ */
+ //rs = ::Report(pReport, pSettings, pSender);
return rs;
}
diff --git a/src/Daemon/MiddleWare.cpp b/src/Daemon/MiddleWare.cpp
index 2fd4f259..932db53d 100644
--- a/src/Daemon/MiddleWare.cpp
+++ b/src/Daemon/MiddleWare.cpp
@@ -273,6 +273,7 @@ void RunAction(const std::string& pActionDir,
void RunActionsAndReporters(const std::string& pDebugDumpDir)
{
vector_pair_string_string_t::iterator it_ar = s_vectorActionsAndReporters.begin();
+ map_plugin_settings_t plugin_settings;
for (; it_ar != s_vectorActionsAndReporters.end(); it_ar++)
{
try
@@ -283,7 +284,7 @@ void RunActionsAndReporters(const std::string& pDebugDumpDir)
map_crash_report_t crashReport;
DebugDumpToCrashReport(pDebugDumpDir, crashReport);
- reporter->Report(crashReport, (*it_ar).second);
+ reporter->Report(crashReport, plugin_settings, (*it_ar).second);
}
else if (g_pPluginManager->GetPluginType((*it_ar).first) == ACTION)
{
@@ -336,7 +337,8 @@ static bool CheckReport(const map_crash_report_t& pCrashReport)
}
report_status_t Report(const map_crash_report_t& pCrashReport,
- const std::string& pUID)
+ map_map_string_t& pSettings,
+ const std::string& pUID)
{
report_status_t ret;
@@ -409,7 +411,8 @@ report_status_t Report(const map_crash_report_t& pCrashReport,
}
}
#endif
- std::string res = reporter->Report(pCrashReport, it_r->second);
+ map_plugin_settings_t plugin_settings = pSettings[pluginName];
+ std::string res = reporter->Report(pCrashReport, plugin_settings, it_r->second);
#if 0 /* Using ~user/.abrt/ is bad wrt security */
if (home != "")
diff --git a/src/Daemon/MiddleWare.h b/src/Daemon/MiddleWare.h
index fab822fe..c78d4d95 100644
--- a/src/Daemon/MiddleWare.h
+++ b/src/Daemon/MiddleWare.h
@@ -93,6 +93,7 @@ void RunActionsAndReporters(const std::string& pDebugDumpDir);
* @return A report status, which reporters ends successfuly with messages.
*/
report_status_t Report(const map_crash_report_t& pCrashReport,
+ map_map_string_t& pSettings,
const std::string& pUID);
/**
* Get debugdump direcotory. If debugdump is not found