diff options
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c | 2 | ||||
-rw-r--r-- | src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c index e5423b181e..286ee58abc 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-reader.c @@ -4512,7 +4512,7 @@ make_wired_setting (shvarFile *ifcfg, gs_free const char **options = NULL; gsize i; - options = nm_utils_strsplit_set_with_empty (value, " "); + options = nm_utils_escaped_tokens_split (value, NM_ASCII_SPACES); for (i = 0; options && options[i]; i++) { const char *line = options[i]; const char *equals; diff --git a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c index b752642dfe..e9a023c5b9 100644 --- a/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c +++ b/src/settings/plugins/ifcfg-rh/nms-ifcfg-rh-writer.c @@ -1121,11 +1121,19 @@ write_wired_setting (NMConnection *connection, shvarFile *ifcfg, GError **error) if (NM_IN_STRSET (s390_key, "portname", "ctcprot")) continue; + if (strchr (s390_key, '=')) { + /* this key cannot be expressed. But after all, it's not valid anyway + * and the connection shouldn't even verify. */ + continue; + } + if (!tmp) tmp = g_string_sized_new (30); else g_string_append_c (tmp, ' '); - g_string_append_printf (tmp, "%s=%s", s390_key, s390_val); + nm_utils_escaped_tokens_escape_gstr (s390_key, NM_ASCII_SPACES, tmp); + g_string_append_c (tmp, '='); + nm_utils_escaped_tokens_escape_gstr (s390_val, NM_ASCII_SPACES, tmp); } if (tmp) svSetValueStr (ifcfg, "OPTIONS", tmp->str); |