diff options
author | Thomas Haller <thaller@redhat.com> | 2022-10-20 12:14:07 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2022-10-27 09:11:29 +0200 |
commit | a20aae326fc8c230c7ac1504dd8270be2aff2f36 (patch) | |
tree | 73b63b5c213cb8dfdecf87e0564de9ff5402962f | |
parent | 053d0a0768be6c67711d5c39154e38a6545e1e8e (diff) |
nmcli: drop validation of DNS name in nmcli
Now, nm_setting_ip_config_add_dns() no longer asserts that
the name is a valid DNS nameserver. Instead, that is handled
by nm_connection_verify().
Also, the DNS property is going to be extended to support
specifying the SNI server name for DNS over TLS. The validation
would need to be extended.
Instead, drop the validation from nmcli. nmcli often needs to understand
what is happening. But in this case, it doesn't need to know (or
validate) the exact text. Don't duplicate the validation and let
libnm (or the daemon) reject invalid settings.
-rw-r--r-- | src/libnmc-setting/nm-meta-setting-desc.c | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/libnmc-setting/nm-meta-setting-desc.c b/src/libnmc-setting/nm-meta-setting-desc.c index 888a0e6962..c4e5e7de03 100644 --- a/src/libnmc-setting/nm-meta-setting-desc.c +++ b/src/libnmc-setting/nm-meta-setting-desc.c @@ -3449,23 +3449,6 @@ _set_fcn_ip_config_method(ARGS_SET_FCN) return TRUE; } -static const char * -_multilist_validate2_fcn_ip_config_dns(NMSetting *setting, const char *value, GError **error) -{ - int addr_family = nm_setting_ip_config_get_addr_family(NM_SETTING_IP_CONFIG(setting)); - - if (!nm_inet_parse_str(addr_family, value, NULL)) { - nm_utils_error_set(error, - NM_UTILS_ERROR_INVALID_ARGUMENT, - _("invalid IPv%c address '%s'"), - nm_utils_addr_family_to_char(addr_family), - value); - return NULL; - } - - return value; -} - static gboolean _multilist_add_fcn_ip_config_dns_options(NMSetting *setting, const char *item) { @@ -6040,7 +6023,6 @@ static const NMMetaPropertyInfo *const property_infos_IP4_CONFIG[] = { .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns), .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns), .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_by_value), - .validate2_fcn = _multilist_validate2_fcn_ip_config_dns, .strsplit_plain = TRUE, ), ), @@ -6293,7 +6275,6 @@ static const NMMetaPropertyInfo *const property_infos_IP6_CONFIG[] = { .add_fcn = MULTILIST_ADD_FCN (NMSettingIPConfig, nm_setting_ip_config_add_dns), .remove_by_idx_fcn_s = MULTILIST_REMOVE_BY_IDX_FCN_S (NMSettingIPConfig, nm_setting_ip_config_remove_dns), .remove_by_value_fcn = MULTILIST_REMOVE_BY_VALUE_FCN (NMSettingIPConfig, nm_setting_ip_config_remove_dns_by_value), - .validate2_fcn = _multilist_validate2_fcn_ip_config_dns, .strsplit_plain = TRUE, ), ), |