diff options
author | Thomas Haller <thaller@redhat.com> | 2015-06-10 17:27:15 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2015-06-13 12:26:39 +0200 |
commit | a7eb5766487c147f25981ff2052a5c244a6a5e1c (patch) | |
tree | 568fc1aba5c8af8b85469e3b546d9023d0cea498 | |
parent | 09c2072efaf3861187677f465b2174ad097f3418 (diff) | |
download | NetworkManager-a7eb5766487c147f25981ff2052a5c244a6a5e1c.tar.gz |
config: ensure nm_config_get_plugins() to return stripped values
-rw-r--r-- | src/nm-config.c | 6 | ||||
-rw-r--r-- | src/settings/nm-settings.c | 11 |
2 files changed, 6 insertions, 11 deletions
diff --git a/src/nm-config.c b/src/nm-config.c index 3e644dcb78..214b870570 100644 --- a/src/nm-config.c +++ b/src/nm-config.c @@ -1397,6 +1397,12 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error) priv->plugins = g_key_file_get_string_list (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "plugins", NULL, NULL); if (!priv->plugins) priv->plugins = g_new0 (char *, 1); + else { + char **p; + + for (p = priv->plugins; *p; p++) + g_strstrip (*p); + } priv->monitor_connection_files = nm_config_keyfile_get_boolean (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "monitor-connection-files", FALSE); diff --git a/src/settings/nm-settings.c b/src/settings/nm-settings.c index a0ba2f5613..5c32d71042 100644 --- a/src/settings/nm-settings.c +++ b/src/settings/nm-settings.c @@ -758,21 +758,10 @@ load_plugins (NMSettings *self, const char **plugins, GError **error) const char **iter; gboolean keyfile_added = FALSE; gboolean success = TRUE; - gs_strfreev char **plugins_stripped = NULL; gboolean add_ibft = FALSE; gboolean has_no_ibft; gssize idx_no_ibft, idx_ibft; - if (plugins) { - char **miter; - - /* preprocess plugin list and strip whitespaces. */ - plugins_stripped = g_strdupv ((char **) plugins); - for (miter = plugins_stripped; *miter; miter++) - g_strstrip (*miter); - plugins = (const char **) plugins_stripped; - } - idx_ibft = _nm_utils_strv_find_first ((char **) plugins, -1, "ibft"); idx_no_ibft = _nm_utils_strv_find_first ((char **) plugins, -1, "no-ibft"); has_no_ibft = idx_no_ibft >= 0 && idx_no_ibft > idx_ibft; |