config: ensure nm_config_get_plugins() to return stripped values

(cherry picked from commit 7e94785f28)
This commit is contained in:
Thomas Haller 2015-06-10 17:27:15 +02:00
parent df1cd73128
commit e713fb5e99
2 changed files with 4 additions and 7 deletions

View file

@ -1008,7 +1008,8 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
else
priv->no_auto_default_file = g_strdup (DEFAULT_NO_AUTO_DEFAULT_FILE);
priv->plugins = g_key_file_get_string_list (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "plugins", NULL, NULL);
priv->plugins = _nm_utils_strv_cleanup (g_key_file_get_string_list (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "plugins", NULL, NULL),
TRUE, TRUE, TRUE);
if (!priv->plugins)
priv->plugins = g_new0 (char *, 1);

View file

@ -685,17 +685,13 @@ load_plugins (NMSettings *self, const char **plugins, GError **error)
GModule *plugin;
gs_free char *full_name = NULL;
gs_free char *path = NULL;
gs_free char *pname = NULL;
const char *pname;
GObject *obj;
GObject * (*factory_func) (void);
struct stat st;
int errsv;
pname = g_strdup (*iter);
g_strstrip (pname);
if (!*pname)
continue;
pname = *iter;
if (!*pname || strchr (pname, '/')) {
LOG (LOGL_WARN, "ignore invalid plugin \"%s\"", pname);