mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-12 23:10:18 +01:00
nmcli: remove interface length check in nmcli
nmcli should not perform checks on the interface name length,
this kind of operations should only be performed by the NetworkManager
daemon and not be duplicated inside cli applications.
(cherry picked from commit 15a8595575)
This commit is contained in:
parent
816aacc4c2
commit
5fb293cfc6
2 changed files with 1 additions and 29 deletions
|
|
@ -4252,18 +4252,10 @@ set_connection_type (NmCli *nmc, NMConnection *con, const OptionInfo *option, co
|
|||
static gboolean
|
||||
set_connection_iface (NmCli *nmc, NMConnection *con, const OptionInfo *option, const char *value, GError **error)
|
||||
{
|
||||
GError *tmp_error = NULL;
|
||||
|
||||
if (value) {
|
||||
/* Special value of '*' means no specific interface name */
|
||||
if (strcmp (value, "*") == 0)
|
||||
value = NULL;
|
||||
else if (!nm_utils_is_valid_iface_name (value, &tmp_error)) {
|
||||
g_set_error (error, NMCLI_ERROR, NMC_RESULT_ERROR_USER_INPUT,
|
||||
_("Error: '%s': %s"), value, tmp_error->message);
|
||||
g_error_free (tmp_error);
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
return set_property (nmc->client,
|
||||
|
|
|
|||
|
|
@ -2089,8 +2089,6 @@ _set_fcn_gobject_ifname (ARGS_SET_FCN)
|
|||
if (_SET_FCN_DO_RESET_DEFAULT (property_info, modifier, value))
|
||||
return _gobject_property_reset_default (setting, property_info->property_name);
|
||||
|
||||
if (!nm_utils_is_valid_iface_name (value, error))
|
||||
return FALSE;
|
||||
g_object_set (setting, property_info->property_name, value, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -2567,24 +2565,6 @@ _multilist_remove_by_value_fcn_connection_permissions (NMSetting *setting,
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
_set_fcn_connection_master (ARGS_SET_FCN)
|
||||
{
|
||||
if (_SET_FCN_DO_RESET_DEFAULT (property_info, modifier, value))
|
||||
value = NULL;
|
||||
else if (!*value)
|
||||
value = NULL;
|
||||
else if ( !nm_utils_is_valid_iface_name (value, NULL)
|
||||
&& !nm_utils_is_uuid (value)) {
|
||||
g_set_error (error, 1, 0,
|
||||
_("'%s' is not valid master; use ifname or connection UUID"),
|
||||
value);
|
||||
return FALSE;
|
||||
}
|
||||
g_object_set (setting, property_info->property_name, value, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static const char *const*
|
||||
_complete_fcn_connection_master (ARGS_COMPLETE_FCN)
|
||||
{
|
||||
|
|
@ -5129,7 +5109,7 @@ static const NMMetaPropertyInfo *const property_infos_CONNECTION[] = {
|
|||
.prompt = NM_META_TEXT_PROMPT_MASTER,
|
||||
.property_type = DEFINE_PROPERTY_TYPE (
|
||||
.get_fcn = _get_fcn_gobject,
|
||||
.set_fcn = _set_fcn_connection_master,
|
||||
.set_fcn = _set_fcn_gobject_string,
|
||||
.complete_fcn = _complete_fcn_connection_master,
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue