diff options
author | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-11-16 15:44:53 +0100 |
---|---|---|
committer | Nikola Pajkovsky <npajkovs@redhat.com> | 2010-11-16 17:23:23 +0100 |
commit | a585af78aee0f6f57d30a2ba261644d05155f4e6 (patch) | |
tree | 7a2ca48cf7ed182cfc5f2bc40212e7da47759b69 | |
parent | d2c60a8a6cb9c02c959f283a370abff780016b07 (diff) | |
download | abrt-a585af78aee0f6f57d30a2ba261644d05155f4e6.tar.gz abrt-a585af78aee0f6f57d30a2ba261644d05155f4e6.tar.xz abrt-a585af78aee0f6f57d30a2ba261644d05155f4e6.zip |
remove unused SetPluginSettings(...)
Signed-off-by: Nikola Pajkovsky <npajkovs@redhat.com>
-rw-r--r-- | src/daemon/CommLayerServerDBus.cpp | 57 | ||||
-rw-r--r-- | src/daemon/Daemon.cpp | 1 | ||||
-rw-r--r-- | src/daemon/PluginManager.cpp | 72 | ||||
-rw-r--r-- | src/daemon/PluginManager.h | 10 | ||||
-rw-r--r-- | src/gui/CCDBusBackend.py | 3 | ||||
-rw-r--r-- | src/gui/PluginsSettingsDialog.py | 3 |
6 files changed, 0 insertions, 146 deletions
diff --git a/src/daemon/CommLayerServerDBus.cpp b/src/daemon/CommLayerServerDBus.cpp index 9866bb35..ecff0920 100644 --- a/src/daemon/CommLayerServerDBus.cpp +++ b/src/daemon/CommLayerServerDBus.cpp @@ -263,28 +263,6 @@ static int handle_Report(DBusMessage* call, DBusMessage* reply) } } -#if 0 - //const char * sender = dbus_message_get_sender(call); - if (!user_conf_data.empty()) - { - 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++) - { - //std::string PluginName = it_user_conf_data->first; - log("plugin:'%s'", it_user_conf_data->first.c_str()); - map_string_t::const_iterator it_plugin_config; - for (it_plugin_config = it_user_conf_data->second.begin(); - it_plugin_config != it_user_conf_data->second.end(); - it_plugin_config++) - { - log("key:'%s' val:'%s'", it_plugin_config->first.c_str(), it_plugin_config->second.c_str()); - } - // this would overwrite the default settings - //g_pPluginManager->SetPluginSettings(PluginName, sender, plugin_settings); - } - } -#endif - long unix_uid = get_remote_uid(call); report_status_t argout1; try @@ -372,39 +350,6 @@ static int handle_GetPluginSettings(DBusMessage* call, DBusMessage* reply) return 0; } -static int handle_SetPluginSettings(DBusMessage* call, DBusMessage* reply) -{ - int r; - DBusMessageIter in_iter; - dbus_message_iter_init(call, &in_iter); - std::string PluginName; - r = load_val(&in_iter, PluginName); - if (r != ABRT_DBUS_MORE_FIELDS) - { - error_msg("dbus call %s: parameter type mismatch", __func__ + 7); - return -1; - } - map_plugin_settings_t plugin_settings; - r = load_val(&in_iter, plugin_settings); - if (r != ABRT_DBUS_LAST_FIELD) - { - error_msg("dbus call %s: parameter type mismatch", __func__ + 7); - return -1; - } - - long unix_uid = get_remote_uid(call); - VERB1 log("got %s('%s',...) call from uid %ld", "SetPluginSettings", PluginName.c_str(), unix_uid); - /* 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; -} - #ifdef PLUGIN_DYNAMIC_LOAD_UNLOAD static int handle_RegisterPlugin(DBusMessage* call, DBusMessage* reply) { @@ -508,8 +453,6 @@ static DBusHandlerResult message_received(DBusConnection* conn, DBusMessage* msg r = handle_GetPluginsInfo(msg, reply); else if (strcmp(member, "GetPluginSettings") == 0) r = handle_GetPluginSettings(msg, reply); - else if (strcmp(member, "SetPluginSettings") == 0) - r = handle_SetPluginSettings(msg, reply); #ifdef PLUGIN_DYNAMIC_LOAD_UNLOAD else if (strcmp(member, "RegisterPlugin") == 0) r = handle_RegisterPlugin(msg, reply); diff --git a/src/daemon/Daemon.cpp b/src/daemon/Daemon.cpp index 7d31ebac..8a011abb 100644 --- a/src/daemon/Daemon.cpp +++ b/src/daemon/Daemon.cpp @@ -71,7 +71,6 @@ using namespace std; * - GetPluginsInfo(): returns map_map_string_t * map["plugin"] = { "Name": "plugin", "Enabled": "yes" ... } * - GetPluginSettings(PluginName): returns map_plugin_settings_t (map_string_t) - * - SetPluginSettings(PluginName, map_plugin_settings_t): returns void * - RegisterPlugin(PluginName): returns void * - UnRegisterPlugin(PluginName): returns void * - GetSettings(): returns map_abrt_settings_t (map_map_string_t) diff --git a/src/daemon/PluginManager.cpp b/src/daemon/PluginManager.cpp index 583b665e..f2501057 100644 --- a/src/daemon/PluginManager.cpp +++ b/src/daemon/PluginManager.cpp @@ -333,75 +333,3 @@ plugin_type_t CPluginManager::GetPluginType(const char *pName) map_loaded_module_t::iterator it_module = m_mapLoadedModules.find(pName); return it_module->second->GetType(); } - -void CPluginManager::SetPluginSettings(const char *pName, - const char *pUID, - const map_plugin_settings_t& pSettings) -{ - map_loaded_module_t::iterator it_module = m_mapLoadedModules.find(pName); - if (it_module == m_mapLoadedModules.end()) - { - return; - } - map_plugin_t::iterator it_plugin = m_mapPlugins.find(pName); - if (it_plugin == m_mapPlugins.end()) - { - return; - } - it_plugin->second->SetSettings(pSettings); - -#if 0 /* Writing to ~user/.abrt/ is bad wrt security */ - if (it_module->second->GetType() != REPORTER) - { - return; - } - - const char *home = get_home_dir(xatoi_u(pUID.c_str())); - if (home == NULL || strlen(home) == 0) - return; - - string confDir = home + "/.abrt"; - string confPath = confDir + "/" + pName + "."PLUGINS_CONF_EXTENSION; - uid_t uid = xatoi_u(pUID.c_str()); - struct passwd* pw = getpwuid(uid); - gid_t gid = pw ? pw->pw_gid : uid; - - struct stat buf; - if (stat(confDir.c_str(), &buf) != 0) - { - if (mkdir(confDir.c_str(), 0700) == -1) - { - perror_msg("Can't create dir '%s'", confDir.c_str()); - return; - } - if (chmod(confDir.c_str(), 0700) == -1) - { - perror_msg("Can't change mod of dir '%s'", confDir.c_str()); - return; - } - if (chown(confDir.c_str(), uid, gid) == -1) - { - perror_msg("Can't change '%s' ownership to %lu:%lu", confPath.c_str(), (long)uid, (long)gid); - return; - } - } - else if (!S_ISDIR(buf.st_mode)) - { - perror_msg("'%s' is not a directory", confDir.c_str()); - return; - } - - /** we don't want to save it from daemon if it's running under root - but wi might get back to this once we make the daemon to not run - with root privileges - */ - /* - SavePluginSettings(confPath, pSettings); - if (chown(confPath.c_str(), uid, gid) == -1) - { - perror_msg("Can't change '%s' ownership to %lu:%lu", confPath.c_str(), (long)uid, (long)gid); - return; - } - */ -#endif -} diff --git a/src/daemon/PluginManager.h b/src/daemon/PluginManager.h index c372aa7f..b6e3e8cf 100644 --- a/src/daemon/PluginManager.h +++ b/src/daemon/PluginManager.h @@ -128,16 +128,6 @@ class CPluginManager * @return A plugin type. */ plugin_type_t GetPluginType(const char *pName); - /** - * A method, which sets up a plugin. The settings are also saved in home - * directory of an user. - * @param pName A plugin name. - * @param pUID An uid of user. - * @param pSettings A plugin's settings. - */ - void SetPluginSettings(const char *pName, - const char *pUID, - const map_plugin_settings_t& pSettings); }; #endif /*PLUGINMANAGER_H_*/ diff --git a/src/gui/CCDBusBackend.py b/src/gui/CCDBusBackend.py index cbc02e34..c3e8f0ab 100644 --- a/src/gui/CCDBusBackend.py +++ b/src/gui/CCDBusBackend.py @@ -215,9 +215,6 @@ class DBusManager(gobject.GObject): # def unRegisterPlugin(self, plugin_name): # return self.daemon().UnRegisterPlugin(plugin_name) - def setPluginSettings(self, plugin_name, plugin_settings): - return self.daemon().SetPluginSettings(plugin_name, plugin_settings) - def getSettings(self): return self.daemon().GetSettings() diff --git a/src/gui/PluginsSettingsDialog.py b/src/gui/PluginsSettingsDialog.py index dfeeb905..aba65d19 100644 --- a/src/gui/PluginsSettingsDialog.py +++ b/src/gui/PluginsSettingsDialog.py @@ -163,9 +163,6 @@ class PluginsSettingsDialog: if pluginfo.Settings: try: pluginfo.save_settings_on_client_side() - # FIXME: do we need to call this? all reporters set their settings - # when Report() is called - self.ccdaemon.setPluginSettings(pluginfo.getName(), pluginfo.Settings) except Exception, e: gui_error_message(_("Cannot save plugin settings:\n %s" % e)) #for key, val in pluginfo.Settings.iteritems(): |