summaryrefslogtreecommitdiffstats
path: root/src/daemon
diff options
context:
space:
mode:
authorNikola Pajkovsky <npajkovs@redhat.com>2011-04-06 17:56:04 +0200
committerNikola Pajkovsky <npajkovs@redhat.com>2011-04-06 17:56:04 +0200
commitc7f1777a5d9c62a1a42f7058de0a7b5bfccc5794 (patch)
tree6ba56a8ba760d6150c1ecee1980c6a4dc0839294 /src/daemon
parent9cd3eb3d3fbf73524d313cfaa1a81873f2e301a8 (diff)
downloadabrt-c7f1777a5d9c62a1a42f7058de0a7b5bfccc5794.zip
abrt-c7f1777a5d9c62a1a42f7058de0a7b5bfccc5794.tar.gz
abrt-c7f1777a5d9c62a1a42f7058de0a7b5bfccc5794.tar.xz
cleanup: get rid of GetPluginsInfo dbus call
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
Diffstat (limited to 'src/daemon')
-rw-r--r--src/daemon/CommLayerServerDBus.cpp15
-rw-r--r--src/daemon/Daemon.cpp2
-rw-r--r--src/daemon/MiddleWare.cpp60
-rw-r--r--src/daemon/MiddleWare.h1
4 files changed, 2 insertions, 76 deletions
diff --git a/src/daemon/CommLayerServerDBus.cpp b/src/daemon/CommLayerServerDBus.cpp
index 0f661f2..b0fd0ed 100644
--- a/src/daemon/CommLayerServerDBus.cpp
+++ b/src/daemon/CommLayerServerDBus.cpp
@@ -305,19 +305,6 @@ static int handle_DeleteDebugDump(DBusMessage* call, DBusMessage* reply)
return 0;
}
-static int handle_GetPluginsInfo(DBusMessage* call, DBusMessage* reply)
-{
- DBusMessageIter out_iter;
- dbus_message_iter_init_append(reply, &out_iter);
-
- map_map_string_t map_of_plugin_info;
- GetPluginsInfo(map_of_plugin_info);
- store_val(&out_iter, map_of_plugin_info);
-
- send_flush_and_unref(reply);
- return 0;
-}
-
static int handle_GetPluginSettings(DBusMessage* call, DBusMessage* reply)
{
int r;
@@ -402,8 +389,6 @@ static DBusHandlerResult message_received(DBusConnection* conn, DBusMessage* msg
r = handle_DeleteDebugDump(msg, reply);
else if (strcmp(member, "CreateReport") == 0)
r = handle_CreateReport(msg, reply);
- else if (strcmp(member, "GetPluginsInfo") == 0)
- r = handle_GetPluginsInfo(msg, reply);
else if (strcmp(member, "GetPluginSettings") == 0)
r = handle_GetPluginSettings(msg, reply);
else if (strcmp(member, "GetSettings") == 0)
diff --git a/src/daemon/Daemon.cpp b/src/daemon/Daemon.cpp
index 1d0467b..59a0726 100644
--- a/src/daemon/Daemon.cpp
+++ b/src/daemon/Daemon.cpp
@@ -65,8 +65,6 @@ using namespace std;
* Returns report_status_t (map_vector_string_t) - the status of each call.
* 2nd parameter is the contents of user's abrt.conf.
* - DeleteDebugDump(crash_id): delete it from DB and delete corresponding /var/spool/abrt/DIR
- * - GetPluginsInfo(): returns map_map_string_t
- * map["plugin"] = { "Name": "plugin", "Enabled": "yes" ... }
* - GetPluginSettings(PluginName): returns map_plugin_settings_t (map_string_t)
* - RegisterPlugin(PluginName): returns void
* - UnRegisterPlugin(PluginName): returns void
diff --git a/src/daemon/MiddleWare.cpp b/src/daemon/MiddleWare.cpp
index ffc2d63..051ffac 100644
--- a/src/daemon/MiddleWare.cpp
+++ b/src/daemon/MiddleWare.cpp
@@ -140,7 +140,8 @@ static mw_result_t CreateCrashReport(const char *dump_dir_name,
if (!uid_matches)
{
dd_close(dd);
- error_msg("Dump directory '%s' can't be accessed by user with uid %ld", dump_dir_name, caller_uid);
+ error_msg("Dump directory '%s' can't be accessed by user with uid %ld",
+ dump_dir_name, caller_uid);
r = MW_PERM_ERROR;
goto ret;
}
@@ -778,63 +779,6 @@ int DeleteDebugDump(const char *dump_dir_name, long caller_uid)
return 0; /* success */
}
-void GetPluginsInfo(map_map_string_t &map_of_plugin_info)
-{
- DIR *dir = opendir(PLUGINS_CONF_DIR);
- if (!dir)
- return;
-
- struct dirent *dent;
- while ((dent = readdir(dir)) != NULL)
- {
- char *ext = strrchr(dent->d_name, '.');
- if (!ext || strcmp(ext + 1, "conf") != 0)
- continue;
- if (!is_regular_file(dent, PLUGINS_CONF_DIR))
- continue;
- VERB3 log("Found %s", dent->d_name);
- *ext = '\0';
-
- char *glade_file = xasprintf(PLUGINS_LIB_DIR"/%s.glade", dent->d_name);
- if (access(glade_file, F_OK) == 0)
- {
- *ext = '.';
- char *conf_file = concat_path_file(PLUGINS_CONF_DIR, dent->d_name);
- *ext = '\0';
- FILE *fp = fopen(conf_file, "r");
- free(conf_file);
-
- char *descr = NULL;
- if (fp)
- {
- descr = xmalloc_fgetline(fp);
- fclose(fp);
- if (descr && strncmp("# Description:", descr, strlen("# Description:")) == 0)
- overlapping_strcpy(descr, skip_whitespace(descr + strlen("# Description:")));
- else
- {
- free(descr);
- descr = NULL;
- }
- }
- map_string_t plugin_info;
- plugin_info["Name"] = dent->d_name;
- plugin_info["Enabled"] = "yes";
- plugin_info["Type"] = "Reporter"; //was: plugin_type_str[module->GetType()]; field to be removed
- plugin_info["Version"] = VERSION; //was: module->GetVersion(); field to be removed?
- plugin_info["Description"] = descr ? descr : ""; //was: module->GetDescription();
- plugin_info["Email"] = ""; //was: module->GetEmail(); field to be removed
- plugin_info["WWW"] = ""; //was: module->GetWWW(); field to be removed
- plugin_info["GTKBuilder"] = glade_file; //was: module->GetGTKBuilder();
- free(descr);
- map_of_plugin_info[dent->d_name] = plugin_info;
- }
- free(glade_file);
-
- }
- closedir(dir);
-}
-
map_string_h *GetPluginSettings(const char *plugin_name)
{
char *conf_file = xasprintf(PLUGINS_CONF_DIR"/%s.conf", plugin_name);
diff --git a/src/daemon/MiddleWare.h b/src/daemon/MiddleWare.h
index fde2997..366a95d 100644
--- a/src/daemon/MiddleWare.h
+++ b/src/daemon/MiddleWare.h
@@ -78,7 +78,6 @@ int CreateReportThread(const char* dump_dir_name, long caller_uid, int force, c
void CreateReport(const char* dump_dir_name, long caller_uid, int force, crash_data_t **crash_data);
int DeleteDebugDump(const char *dump_dir_name, long caller_uid);
-void GetPluginsInfo(map_map_string_t &map_of_plugin_info);
map_string_h *GetPluginSettings(const char *plugin_name);
#endif /*MIDDLEWARE_H_*/