From 21f71192a92b93006e6358531e0aa46de192acb9 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Tue, 18 Dec 2012 17:25:34 +0200 Subject: [PATCH] core: Remove DisablePlugins main.conf entry The plugins can still be disabled through the -P command line switch. --- src/hcid.h | 3 +-- src/main.c | 3 +-- src/main.conf | 3 --- src/plugin.c | 33 +++++++-------------------------- 4 files changed, 9 insertions(+), 33 deletions(-) diff --git a/src/hcid.h b/src/hcid.h index aa563dc67..5752da9d8 100644 --- a/src/hcid.h +++ b/src/hcid.h @@ -50,8 +50,7 @@ enum { extern struct main_opts main_opts; -gboolean plugin_init(GKeyFile *config, const char *enable, - const char *disable); +gboolean plugin_init(const char *enable, const char *disable); void plugin_cleanup(void); void rfkill_init(void); diff --git a/src/main.c b/src/main.c index d302ffa26..7922222c7 100644 --- a/src/main.c +++ b/src/main.c @@ -68,7 +68,6 @@ struct main_opts main_opts; static const char * const supported_options[] = { "Name", - "DisablePlugins", "Class", "DiscoverableTimeout", "PairableTimeout", @@ -539,7 +538,7 @@ int main(int argc, char *argv[]) * the plugins might wanna expose some paths on the bus. However the * best order of how to init various subsystems of the Bluetooth * daemon needs to be re-worked. */ - plugin_init(config, option_plugin, option_noplugin); + plugin_init(option_plugin, option_noplugin); /* no need to keep parsed option in memory */ free_options(); diff --git a/src/main.conf b/src/main.conf index 97b451982..8bb82f672 100644 --- a/src/main.conf +++ b/src/main.conf @@ -1,8 +1,5 @@ [General] -# List of plugins that should not be loaded on bluetoothd startup -#DisablePlugins = network,input - # Default adaper name # %h - substituted for hostname # %d - substituted for adapter id diff --git a/src/plugin.c b/src/plugin.c index 5622d7b06..f231f3446 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -84,19 +84,9 @@ static gboolean add_plugin(void *handle, struct bluetooth_plugin_desc *desc) return TRUE; } -static gboolean enable_plugin(const char *name, char **conf_disable, - char **cli_enable, char **cli_disable) +static gboolean enable_plugin(const char *name, char **cli_enable, + char **cli_disable) { - if (conf_disable) { - for (; *conf_disable; conf_disable++) - if (g_pattern_match_simple(*conf_disable, name)) - break; - if (*conf_disable) { - info("Excluding (conf) %s", name); - return FALSE; - } - } - if (cli_disable) { for (; *cli_disable; cli_disable++) if (g_pattern_match_simple(*cli_disable, name)) @@ -122,25 +112,18 @@ static gboolean enable_plugin(const char *name, char **conf_disable, #include "builtin.h" -gboolean plugin_init(GKeyFile *config, const char *enable, const char *disable) +gboolean plugin_init(const char *enable, const char *disable) { GSList *list; GDir *dir; const gchar *file; - char **conf_disabled, **cli_disabled, **cli_enabled; + char **cli_disabled, **cli_enabled; unsigned int i; /* Make a call to BtIO API so its symbols got resolved before the * plugins are loaded. */ bt_io_error_quark(); - if (config) - conf_disabled = g_key_file_get_string_list(config, "General", - "DisablePlugins", - NULL, NULL); - else - conf_disabled = NULL; - if (enable) cli_enabled = g_strsplit_set(enable, ", ", -1); else @@ -154,8 +137,8 @@ gboolean plugin_init(GKeyFile *config, const char *enable, const char *disable) DBG("Loading builtin plugins"); for (i = 0; __bluetooth_builtin[i]; i++) { - if (!enable_plugin(__bluetooth_builtin[i]->name, conf_disabled, - cli_enabled, cli_disabled)) + if (!enable_plugin(__bluetooth_builtin[i]->name, cli_enabled, + cli_disabled)) continue; add_plugin(NULL, __bluetooth_builtin[i]); @@ -198,8 +181,7 @@ gboolean plugin_init(GKeyFile *config, const char *enable, const char *disable) continue; } - if (!enable_plugin(desc->name, conf_disabled, - cli_enabled, cli_disabled)) { + if (!enable_plugin(desc->name, cli_enabled, cli_disabled)) { dlclose(handle); continue; } @@ -222,7 +204,6 @@ start: plugin->active = TRUE; } - g_strfreev(conf_disabled); g_strfreev(cli_enabled); g_strfreev(cli_disabled); -- 2.47.3