From d59f046bb62dc9b655a1c3f585ea8b06128fe07a Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 12 Apr 2019 12:10:33 +0200 Subject: [PATCH] cli: use nm_utils_escaped_tokens_*() for handling policy routes Optimally, all list types properties in nmcli support proper escaping. For that, we should use nm_utils_escaped_tokens_*() API. For now, just change that for policy routes. They were just added recently, so no change in behavior of released API. --- clients/common/nm-meta-setting-desc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index aa2bcd4f6f..2a4e5b8269 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -3400,7 +3400,7 @@ _objlist_obj_to_str_fcn_ip_config_routing_rules (NMMetaAccessorGetType get_type, NULL, NULL); if (s) - g_string_append (str, s); + nm_utils_escaped_tokens_escape_gstr (s, ESCAPED_TOKENS_DELIMTERS, str); } static gboolean @@ -5670,7 +5670,7 @@ static const NMMetaPropertyInfo *const property_infos_IP4_CONFIG[] = { .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routing_rules, .set_fcn = _objlist_set_fcn_ip_config_routing_rules, .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingIPConfig, nm_setting_ip_config_remove_routing_rule), - .strsplit_with_escape = TRUE, + .strsplit_escaped_tokens = TRUE, ), ), ), @@ -5878,7 +5878,7 @@ static const NMMetaPropertyInfo *const property_infos_IP6_CONFIG[] = { .obj_to_str_fcn = _objlist_obj_to_str_fcn_ip_config_routing_rules, .set_fcn = _objlist_set_fcn_ip_config_routing_rules, .remove_by_idx_fcn_u = OBJLIST_REMOVE_BY_IDX_FCN_U (NMSettingIPConfig, nm_setting_ip_config_remove_routing_rule), - .strsplit_with_escape = TRUE, + .strsplit_escaped_tokens = TRUE, ), ), ),