summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-06-16 14:59:29 +0200
committerThomas Haller <thaller@redhat.com>2015-06-16 15:38:47 +0200
commit64c1d2cb4ce60758ae3066eb0e77095e6cbb4fdb (patch)
tree1edb15c8bdf5ca698c5be6ff5ea8deaa13137316
parenteecca86da74ca04b4defbf2f154bb4e8846e4a62 (diff)
downloadNetworkManager-64c1d2cb4ce60758ae3066eb0e77095e6cbb4fdb.tar.gz
config: strip white space from configuration values
https://bugzilla.gnome.org/show_bug.cgi?id=750659
-rw-r--r--src/nm-config-data.c6
-rw-r--r--src/nm-config.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/nm-config-data.c b/src/nm-config-data.c
index 46865ac4de..1e0e6e3573 100644
--- a/src/nm-config-data.c
+++ b/src/nm-config-data.c
@@ -800,7 +800,7 @@ constructed (GObject *object)
priv->connection_infos = _get_connection_infos (priv->keyfile);
- priv->connectivity.uri = g_key_file_get_string (priv->keyfile, NM_CONFIG_KEYFILE_GROUP_CONNECTIVITY, "uri", NULL);
+ priv->connectivity.uri = nm_strstrip (g_key_file_get_string (priv->keyfile, NM_CONFIG_KEYFILE_GROUP_CONNECTIVITY, "uri", NULL));
priv->connectivity.response = g_key_file_get_string (priv->keyfile, NM_CONFIG_KEYFILE_GROUP_CONNECTIVITY, "response", NULL);
/* On missing config value, fallback to 300. On invalid value, disable connectivity checking by setting
@@ -811,8 +811,8 @@ constructed (GObject *object)
: NM_CONFIG_DEFAULT_CONNECTIVITY_INTERVAL;
g_free (interval);
- priv->dns_mode = g_key_file_get_string (priv->keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "dns", NULL);
- priv->rc_manager = g_key_file_get_string (priv->keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "rc-manager", NULL);
+ priv->dns_mode = nm_strstrip (g_key_file_get_string (priv->keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "dns", NULL));
+ priv->rc_manager = nm_strstrip (g_key_file_get_string (priv->keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "rc-manager", NULL));
priv->ignore_carrier = nm_config_get_device_match_spec (priv->keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "ignore-carrier", NULL);
priv->assume_ipv6ll_only = nm_config_get_device_match_spec (priv->keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "assume-ipv6ll-only", NULL);
diff --git a/src/nm-config.c b/src/nm-config.c
index f06c5a9f7b..c58094d035 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -1550,10 +1550,10 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
priv->auth_polkit = nm_config_keyfile_get_boolean (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "auth-polkit", NM_CONFIG_DEFAULT_AUTH_POLKIT);
- priv->dhcp_client = g_key_file_get_string (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "dhcp", NULL);
+ priv->dhcp_client = nm_strstrip (g_key_file_get_string (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "dhcp", NULL));
- priv->log_level = g_key_file_get_string (keyfile, NM_CONFIG_KEYFILE_GROUP_LOGGING, "level", NULL);
- priv->log_domains = g_key_file_get_string (keyfile, NM_CONFIG_KEYFILE_GROUP_LOGGING, "domains", NULL);
+ priv->log_level = nm_strstrip (g_key_file_get_string (keyfile, NM_CONFIG_KEYFILE_GROUP_LOGGING, "level", NULL));
+ priv->log_domains = nm_strstrip (g_key_file_get_string (keyfile, NM_CONFIG_KEYFILE_GROUP_LOGGING, "domains", NULL));
priv->debug = g_key_file_get_string (keyfile, NM_CONFIG_KEYFILE_GROUP_MAIN, "debug", NULL);