summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2015-06-16 14:59:29 +0200
committerThomas Haller <thaller@redhat.com>2015-07-02 15:50:04 +0200
commit076ffda6f395b37b497929de0838688db8eba84a (patch)
treed9e25db1d1be779f2804746846211b32817e32a2
parent7498b670a828d335e177003c9d00d68802f52561 (diff)
downloadNetworkManager-076ffda6f395b37b497929de0838688db8eba84a.tar.gz
config: strip white space from configuration values
https://bugzilla.gnome.org/show_bug.cgi?id=750659 https://bugzilla.redhat.com/show_bug.cgi?id=1229861
-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 424fe3b7fb..36fc388138 100644
--- a/src/nm-config-data.c
+++ b/src/nm-config-data.c
@@ -635,7 +635,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
@@ -646,8 +646,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 b59bf5c203..94993dabe1 100644
--- a/src/nm-config.c
+++ b/src/nm-config.c
@@ -1019,10 +1019,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);