mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-26 19:20:12 +01:00
libnm: add direct_string_allow_empty meta data for NMSetting property
Most string properties should not accept empty strings. Add a generic way to reject them during verify. Add a new flag NMSettInfoProperty.direct_string_allow_empty. Note that properties must opt-in to allow empty values. Since all existing properties didn't have this check (but hopefully re-implemented it in verify()), all existing properties get this flag set to TRUE. The main point here it that new properties get the strict check by default. We should also review existing uses of direct_string_allow_empty, whether the flag can be cleared. This can be done if verify() already enforces a non-empty string, or if we accept to break behavior by tightening up the check.
This commit is contained in:
parent
e6abcb4d67
commit
d8e51faee7
40 changed files with 297 additions and 126 deletions
|
|
@ -176,7 +176,8 @@ nm_setting_6lowpan_class_init(NMSetting6LowpanClass *klass)
|
|||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSetting6LowpanPrivate,
|
||||
parent);
|
||||
parent,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -3248,7 +3248,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_IDENTITY,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
identity);
|
||||
identity,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:anonymous-identity:
|
||||
|
|
@ -3269,7 +3270,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_ANONYMOUS_IDENTITY,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
anonymous_identity);
|
||||
anonymous_identity,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:pac-file:
|
||||
|
|
@ -3289,7 +3291,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PAC_FILE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
pac_file);
|
||||
pac_file,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:ca-cert:
|
||||
|
|
@ -3342,7 +3345,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_CA_CERT_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSetting8021xPrivate,
|
||||
ca_cert_password);
|
||||
ca_cert_password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:ca-cert-password-flags:
|
||||
|
|
@ -3380,7 +3384,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_CA_PATH,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
ca_path);
|
||||
ca_path,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:subject-match:
|
||||
|
|
@ -3406,7 +3411,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
subject_match,
|
||||
.is_deprecated = TRUE, );
|
||||
.is_deprecated = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:altsubject-matches:
|
||||
|
|
@ -3453,7 +3459,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_DOMAIN_SUFFIX_MATCH,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
domain_suffix_match);
|
||||
domain_suffix_match,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:domain-match:
|
||||
|
|
@ -3479,7 +3486,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_DOMAIN_MATCH,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
domain_match);
|
||||
domain_match,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:client-cert:
|
||||
|
|
@ -3527,7 +3535,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_CLIENT_CERT_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSetting8021xPrivate,
|
||||
client_cert_password);
|
||||
client_cert_password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:client-cert-password-flags:
|
||||
|
|
@ -3566,7 +3575,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE1_PEAPVER,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
phase1_peapver);
|
||||
phase1_peapver,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase1-peaplabel:
|
||||
|
|
@ -3590,7 +3600,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE1_PEAPLABEL,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
phase1_peaplabel);
|
||||
phase1_peaplabel,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase1-fast-provisioning:
|
||||
|
|
@ -3616,7 +3627,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE1_FAST_PROVISIONING,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
phase1_fast_provisioning);
|
||||
phase1_fast_provisioning,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase1-auth-flags:
|
||||
|
|
@ -3680,7 +3692,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE2_AUTH,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
phase2_auth);
|
||||
phase2_auth,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase2-autheap:
|
||||
|
|
@ -3707,7 +3720,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE2_AUTHEAP,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
phase2_autheap);
|
||||
phase2_autheap,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase2-ca-cert:
|
||||
|
|
@ -3754,7 +3768,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE2_CA_CERT_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSetting8021xPrivate,
|
||||
phase2_ca_cert_password);
|
||||
phase2_ca_cert_password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase2-ca-cert-password-flags:
|
||||
|
|
@ -3792,7 +3807,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE2_CA_PATH,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
phase2_ca_path);
|
||||
phase2_ca_path,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase2-subject-match:
|
||||
|
|
@ -3819,7 +3835,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
phase2_subject_match,
|
||||
.is_deprecated = TRUE, );
|
||||
.is_deprecated = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase2-altsubject-matches:
|
||||
|
|
@ -3866,7 +3883,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE2_DOMAIN_SUFFIX_MATCH,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
phase2_domain_suffix_match);
|
||||
phase2_domain_suffix_match,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase2-domain-match:
|
||||
|
|
@ -3893,7 +3911,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE2_DOMAIN_MATCH,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSetting8021xPrivate,
|
||||
phase2_domain_match);
|
||||
phase2_domain_match,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase2-client-cert:
|
||||
|
|
@ -3944,7 +3963,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE2_CLIENT_CERT_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSetting8021xPrivate,
|
||||
phase2_client_cert_password);
|
||||
phase2_client_cert_password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase2-client-cert-password-flags:
|
||||
|
|
@ -3981,7 +4001,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSetting8021xPrivate,
|
||||
password);
|
||||
password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:password-flags:
|
||||
|
|
@ -4113,7 +4134,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PRIVATE_KEY_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSetting8021xPrivate,
|
||||
private_key_password);
|
||||
private_key_password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:private-key-password-flags:
|
||||
|
|
@ -4199,7 +4221,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PHASE2_PRIVATE_KEY_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSetting8021xPrivate,
|
||||
phase2_private_key_password);
|
||||
phase2_private_key_password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:phase2-private-key-password-flags:
|
||||
|
|
@ -4239,7 +4262,8 @@ nm_setting_802_1x_class_init(NMSetting8021xClass *klass)
|
|||
PROP_PIN,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSetting8021xPrivate,
|
||||
pin);
|
||||
pin,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSetting8021x:pin-flags:
|
||||
|
|
|
|||
|
|
@ -283,7 +283,8 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
|
|||
PROP_USERNAME,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingAdslPrivate,
|
||||
username);
|
||||
username,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingAdsl:password:
|
||||
|
|
@ -296,7 +297,8 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
|
|||
PROP_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingAdslPrivate,
|
||||
password);
|
||||
password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingAdsl:password-flags:
|
||||
|
|
@ -322,7 +324,8 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
|
|||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingAdslPrivate,
|
||||
protocol,
|
||||
.direct_set_string_ascii_strdown = TRUE);
|
||||
.direct_set_string_ascii_strdown = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingAdsl:encapsulation:
|
||||
|
|
@ -336,7 +339,8 @@ nm_setting_adsl_class_init(NMSettingAdslClass *klass)
|
|||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingAdslPrivate,
|
||||
encapsulation,
|
||||
.direct_set_string_ascii_strdown = TRUE);
|
||||
.direct_set_string_ascii_strdown = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingAdsl:vpi:
|
||||
|
|
|
|||
|
|
@ -283,7 +283,8 @@ nm_setting_bluetooth_class_init(NMSettingBluetoothClass *klass)
|
|||
PROP_TYPE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingBluetoothPrivate,
|
||||
type);
|
||||
type,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -1811,7 +1811,8 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass)
|
|||
PROP_VLAN_PROTOCOL,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingBridge,
|
||||
_priv.vlan_protocol);
|
||||
_priv.vlan_protocol,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingBridge:vlan-stats-enabled:
|
||||
|
|
@ -1862,7 +1863,8 @@ nm_setting_bridge_class_init(NMSettingBridgeClass *klass)
|
|||
PROP_MULTICAST_ROUTER,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingBridge,
|
||||
_priv.multicast_router);
|
||||
_priv.multicast_router,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingBridge:multicast-query-use-ifaddr:
|
||||
|
|
|
|||
|
|
@ -236,7 +236,8 @@ nm_setting_cdma_class_init(NMSettingCdmaClass *klass)
|
|||
PROP_NUMBER,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingCdmaPrivate,
|
||||
number);
|
||||
number,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingCdma:username:
|
||||
|
|
@ -251,7 +252,8 @@ nm_setting_cdma_class_init(NMSettingCdmaClass *klass)
|
|||
PROP_USERNAME,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingCdmaPrivate,
|
||||
username);
|
||||
username,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingCdma:password:
|
||||
|
|
@ -266,7 +268,8 @@ nm_setting_cdma_class_init(NMSettingCdmaClass *klass)
|
|||
PROP_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingCdmaPrivate,
|
||||
password);
|
||||
password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingCdma:password-flags:
|
||||
|
|
|
|||
|
|
@ -2021,7 +2021,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
.from_dbus_is_full = TRUE,
|
||||
.from_dbus_direct_allow_transform = TRUE),
|
||||
NMSettingConnectionPrivate,
|
||||
id);
|
||||
id,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:uuid:
|
||||
|
|
@ -2064,7 +2065,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
PROP_UUID,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
NMSettingConnectionPrivate,
|
||||
uuid);
|
||||
uuid,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:stable-id:
|
||||
|
|
@ -2122,7 +2124,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
PROP_STABLE_ID,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
NMSettingConnectionPrivate,
|
||||
stable_id);
|
||||
stable_id,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:interface-name:
|
||||
|
|
@ -2163,7 +2166,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
.from_dbus_is_full = TRUE,
|
||||
.from_dbus_direct_allow_transform = TRUE),
|
||||
NMSettingConnectionPrivate,
|
||||
interface_name);
|
||||
interface_name,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:type:
|
||||
|
|
@ -2190,7 +2194,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingConnectionPrivate,
|
||||
type,
|
||||
.direct_string_is_refstr = TRUE);
|
||||
.direct_string_is_refstr = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:permissions:
|
||||
|
|
@ -2422,7 +2427,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
NM_SETTING_PARAM_FUZZY_IGNORE
|
||||
| NM_SETTING_PARAM_REAPPLY_IMMEDIATELY,
|
||||
NMSettingConnectionPrivate,
|
||||
zone);
|
||||
zone,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:master:
|
||||
|
|
@ -2453,7 +2459,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
.from_dbus_fcn = _nm_setting_connection_master_from_dbus, ),
|
||||
NMSettingConnectionPrivate,
|
||||
controller,
|
||||
.is_deprecated = 1);
|
||||
.direct_string_allow_empty = TRUE,
|
||||
.is_deprecated = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:controller:
|
||||
|
|
@ -2474,7 +2481,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
_nm_setting_connection_controller_from_dbus),
|
||||
NMSettingConnectionPrivate,
|
||||
controller,
|
||||
.direct_also_notify = obj_properties[PROP_MASTER]);
|
||||
.direct_string_allow_empty = TRUE,
|
||||
.direct_also_notify = obj_properties[PROP_MASTER]);
|
||||
|
||||
nm_g_array_index(properties_override, NMSettInfoProperty, prop_idx).direct_also_notify =
|
||||
obj_properties[PROP_CONTROLLER];
|
||||
|
|
@ -2512,7 +2520,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
_nm_setting_connection_slave_type_from_dbus, ),
|
||||
NMSettingConnectionPrivate,
|
||||
port_type,
|
||||
.is_deprecated = 1);
|
||||
.is_deprecated = 1,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:port-type:
|
||||
|
|
@ -2537,7 +2546,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
_nm_setting_connection_port_type_from_dbus, ),
|
||||
NMSettingConnectionPrivate,
|
||||
port_type,
|
||||
.direct_also_notify = obj_properties[PROP_SLAVE_TYPE]);
|
||||
.direct_string_allow_empty = TRUE,
|
||||
.direct_also_notify = obj_properties[PROP_SLAVE_TYPE]);
|
||||
|
||||
nm_g_array_index(properties_override, NMSettInfoProperty, prop_idx).direct_also_notify =
|
||||
obj_properties[PROP_PORT_TYPE];
|
||||
|
|
@ -2987,7 +2997,8 @@ nm_setting_connection_class_init(NMSettingConnectionClass *klass)
|
|||
PROP_MUD_URL,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingConnectionPrivate,
|
||||
mud_url);
|
||||
mud_url,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingConnection:wait-activation-delay:
|
||||
|
|
|
|||
|
|
@ -920,7 +920,8 @@ nm_setting_dcb_class_init(NMSettingDcbClass *klass)
|
|||
PROP_APP_FCOE_MODE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingDcbPrivate,
|
||||
app_fcoe_mode);
|
||||
app_fcoe_mode,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingDcb:app-iscsi-flags:
|
||||
|
|
|
|||
|
|
@ -602,7 +602,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingGsmPrivate,
|
||||
number,
|
||||
.is_deprecated = TRUE, );
|
||||
.is_deprecated = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:username:
|
||||
|
|
@ -617,7 +618,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
PROP_USERNAME,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingGsmPrivate,
|
||||
username);
|
||||
username,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:password:
|
||||
|
|
@ -632,7 +634,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
PROP_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingGsmPrivate,
|
||||
password);
|
||||
password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:password-flags:
|
||||
|
|
@ -663,7 +666,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingGsmPrivate,
|
||||
apn,
|
||||
.direct_set_string_strip = TRUE);
|
||||
.direct_set_string_strip = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:network-id:
|
||||
|
|
@ -681,7 +685,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingGsmPrivate,
|
||||
network_id,
|
||||
.direct_set_string_strip = TRUE);
|
||||
.direct_set_string_strip = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:pin:
|
||||
|
|
@ -696,7 +701,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
PROP_PIN,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingGsmPrivate,
|
||||
pin);
|
||||
pin,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:pin-flags:
|
||||
|
|
@ -740,7 +746,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
PROP_DEVICE_ID,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingGsmPrivate,
|
||||
device_id);
|
||||
device_id,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:sim-id:
|
||||
|
|
@ -758,7 +765,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
PROP_SIM_ID,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingGsmPrivate,
|
||||
sim_id);
|
||||
sim_id,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:sim-operator-id:
|
||||
|
|
@ -777,7 +785,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
PROP_SIM_OPERATOR_ID,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingGsmPrivate,
|
||||
sim_operator_id);
|
||||
sim_operator_id,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingGsm:mtu:
|
||||
|
|
@ -831,7 +840,8 @@ nm_setting_gsm_class_init(NMSettingGsmClass *klass)
|
|||
PROP_INITIAL_EPS_APN,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingGsmPrivate,
|
||||
initial_eps_apn);
|
||||
initial_eps_apn,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/* Ignore incoming deprecated properties */
|
||||
_nm_properties_override_dbus(properties_override,
|
||||
|
|
|
|||
|
|
@ -209,7 +209,8 @@ nm_setting_hsr_class_init(NMSettingHsrClass *klass)
|
|||
PROP_PORT1,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingHsr,
|
||||
_priv.port1);
|
||||
_priv.port1,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingHsr:port2:
|
||||
|
|
@ -224,7 +225,8 @@ nm_setting_hsr_class_init(NMSettingHsrClass *klass)
|
|||
PROP_PORT2,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingHsr,
|
||||
_priv.port2);
|
||||
_priv.port2,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingHsr:multicast-spec:
|
||||
|
|
|
|||
|
|
@ -414,7 +414,8 @@ nm_setting_infiniband_class_init(NMSettingInfinibandClass *klass)
|
|||
PROP_TRANSPORT_MODE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingInfinibandPrivate,
|
||||
transport_mode);
|
||||
transport_mode,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingInfiniband:p-key:
|
||||
|
|
@ -480,7 +481,8 @@ nm_setting_infiniband_class_init(NMSettingInfinibandClass *klass)
|
|||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingInfinibandPrivate,
|
||||
parent);
|
||||
parent,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -5951,7 +5951,8 @@ _nm_sett_info_property_override_create_array_ip_config(int addr_family)
|
|||
properties_override,
|
||||
obj_properties[PROP_METHOD],
|
||||
&nm_sett_info_propert_type_direct_string,
|
||||
.direct_offset = NM_STRUCT_OFFSET_ENSURE_TYPE(char *, NMSettingIPConfigPrivate, method));
|
||||
.direct_offset = NM_STRUCT_OFFSET_ENSURE_TYPE(char *, NMSettingIPConfigPrivate, method),
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
|
|
@ -5964,20 +5965,23 @@ _nm_sett_info_property_override_create_array_ip_config(int addr_family)
|
|||
.from_dbus_fcn = _nm_setting_property_from_dbus_fcn_direct_ip_config_gateway),
|
||||
.direct_offset = NM_STRUCT_OFFSET_ENSURE_TYPE(char *, NMSettingIPConfigPrivate, gateway),
|
||||
.direct_set_string_ip_address_addr_family = addr_family + 1,
|
||||
.direct_set_string_ip_address_addr_family_map_zero_to_null = TRUE);
|
||||
.direct_set_string_ip_address_addr_family_map_zero_to_null = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_DHCP_HOSTNAME],
|
||||
&nm_sett_info_propert_type_direct_string,
|
||||
.direct_offset =
|
||||
NM_STRUCT_OFFSET_ENSURE_TYPE(char *, NMSettingIPConfigPrivate, dhcp_hostname));
|
||||
NM_STRUCT_OFFSET_ENSURE_TYPE(char *, NMSettingIPConfigPrivate, dhcp_hostname),
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
_nm_properties_override_gobj(
|
||||
properties_override,
|
||||
obj_properties[PROP_DHCP_IAID],
|
||||
&nm_sett_info_propert_type_direct_string,
|
||||
.direct_offset = NM_STRUCT_OFFSET_ENSURE_TYPE(char *, NMSettingIPConfigPrivate, dhcp_iaid));
|
||||
.direct_offset = NM_STRUCT_OFFSET_ENSURE_TYPE(char *, NMSettingIPConfigPrivate, dhcp_iaid),
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/* ---dbus---
|
||||
* property: routing-rules
|
||||
|
|
|
|||
|
|
@ -584,7 +584,8 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingIPTunnelPrivate,
|
||||
parent);
|
||||
parent,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:mode:
|
||||
|
|
@ -630,7 +631,8 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
PROP_LOCAL,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingIPTunnelPrivate,
|
||||
local);
|
||||
local,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:remote:
|
||||
|
|
@ -646,7 +648,8 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
PROP_REMOTE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingIPTunnelPrivate,
|
||||
remote);
|
||||
remote,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:ttl
|
||||
|
|
@ -716,7 +719,8 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
PROP_INPUT_KEY,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingIPTunnelPrivate,
|
||||
input_key);
|
||||
input_key,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:output-key:
|
||||
|
|
@ -732,7 +736,8 @@ nm_setting_ip_tunnel_class_init(NMSettingIPTunnelClass *klass)
|
|||
PROP_OUTPUT_KEY,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingIPTunnelPrivate,
|
||||
output_key);
|
||||
output_key,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingIPTunnel:encapsulation-limit:
|
||||
|
|
|
|||
|
|
@ -919,7 +919,8 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
PROP_DHCP_CLIENT_ID,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingIP4ConfigPrivate,
|
||||
dhcp_client_id);
|
||||
dhcp_client_id,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/* ---ifcfg-rh---
|
||||
* property: dad-timeout
|
||||
|
|
@ -972,7 +973,8 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
PROP_DHCP_FQDN,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingIP4ConfigPrivate,
|
||||
dhcp_fqdn);
|
||||
dhcp_fqdn,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingIP4Config:dhcp-vendor-class-identifier:
|
||||
|
|
@ -999,7 +1001,8 @@ nm_setting_ip4_config_class_init(NMSettingIP4ConfigClass *klass)
|
|||
PROP_DHCP_VENDOR_CLASS_IDENTIFIER,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingIP4ConfigPrivate,
|
||||
dhcp_vendor_class_identifier);
|
||||
dhcp_vendor_class_identifier,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingIP4Config:link-local:
|
||||
|
|
|
|||
|
|
@ -1069,7 +1069,8 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
PROP_TOKEN,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingIP6ConfigPrivate,
|
||||
token);
|
||||
token,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingIP6Config:ra-timeout:
|
||||
|
|
@ -1172,7 +1173,8 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
PROP_DHCP_DUID,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingIP6ConfigPrivate,
|
||||
dhcp_duid);
|
||||
dhcp_duid,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingIP6Config:dhcp-pd-hint:
|
||||
|
|
@ -1201,7 +1203,8 @@ nm_setting_ip6_config_class_init(NMSettingIP6ConfigClass *klass)
|
|||
NMSettingIP6ConfigPrivate,
|
||||
dhcp_pd_hint,
|
||||
.direct_set_fcn.set_string =
|
||||
_set_string_fcn_dhcp_pd_hint);
|
||||
_set_string_fcn_dhcp_pd_hint,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/* IP6-specific property overrides */
|
||||
|
||||
|
|
|
|||
|
|
@ -456,7 +456,8 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
|||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingMacsecPrivate,
|
||||
parent);
|
||||
parent,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingMacsec:mode:
|
||||
|
|
@ -507,7 +508,8 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
|||
PROP_MKA_CAK,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingMacsecPrivate,
|
||||
mka_cak);
|
||||
mka_cak,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingMacsec:mka-cak-flags:
|
||||
|
|
@ -539,7 +541,8 @@ nm_setting_macsec_class_init(NMSettingMacsecClass *klass)
|
|||
PROP_MKA_CKN,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingMacsecPrivate,
|
||||
mka_ckn);
|
||||
mka_ckn,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingMacsec:port:
|
||||
|
|
|
|||
|
|
@ -226,7 +226,8 @@ nm_setting_macvlan_class_init(NMSettingMacvlanClass *klass)
|
|||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingMacvlanPrivate,
|
||||
parent);
|
||||
parent,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingMacvlan:mode:
|
||||
|
|
|
|||
|
|
@ -242,7 +242,8 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
|||
PROP_FAIL_MODE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingOvsBridge,
|
||||
fail_mode);
|
||||
fail_mode,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingOvsBridge:mcast-snooping-enable:
|
||||
|
|
@ -305,7 +306,8 @@ nm_setting_ovs_bridge_class_init(NMSettingOvsBridgeClass *klass)
|
|||
PROP_DATAPATH_TYPE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingOvsBridge,
|
||||
datapath_type);
|
||||
datapath_type,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -190,7 +190,8 @@ nm_setting_ovs_dpdk_class_init(NMSettingOvsDpdkClass *klass)
|
|||
PROP_DEVARGS,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingOvsDpdk,
|
||||
devargs);
|
||||
devargs,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingOvsDpdk:n-rxq:
|
||||
|
|
|
|||
|
|
@ -394,7 +394,8 @@ nm_setting_ovs_interface_class_init(NMSettingOvsInterfaceClass *klass)
|
|||
PROP_TYPE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingOvsInterface,
|
||||
type);
|
||||
type,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
/**
|
||||
* NMSettingOvsInterface:ofport-request:
|
||||
*
|
||||
|
|
|
|||
|
|
@ -138,7 +138,8 @@ nm_setting_ovs_patch_class_init(NMSettingOvsPatchClass *klass)
|
|||
PROP_PEER,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingOvsPatch,
|
||||
peer);
|
||||
peer,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -614,7 +614,8 @@ nm_setting_ovs_port_class_init(NMSettingOvsPortClass *klass)
|
|||
PROP_VLAN_MODE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingOvsPort,
|
||||
vlan_mode);
|
||||
vlan_mode,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingOvsPort:tag:
|
||||
|
|
@ -672,7 +673,8 @@ nm_setting_ovs_port_class_init(NMSettingOvsPortClass *klass)
|
|||
PROP_LACP,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingOvsPort,
|
||||
lacp);
|
||||
lacp,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingOvsPort:bond-mode:
|
||||
|
|
@ -687,7 +689,8 @@ nm_setting_ovs_port_class_init(NMSettingOvsPortClass *klass)
|
|||
PROP_BOND_MODE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingOvsPort,
|
||||
bond_mode);
|
||||
bond_mode,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingOvsPort:bond-updelay:
|
||||
|
|
|
|||
|
|
@ -240,7 +240,8 @@ nm_setting_pppoe_class_init(NMSettingPppoeClass *klass)
|
|||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingPppoePrivate,
|
||||
parent);
|
||||
parent,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingPppoe:service:
|
||||
|
|
@ -256,7 +257,8 @@ nm_setting_pppoe_class_init(NMSettingPppoeClass *klass)
|
|||
PROP_SERVICE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingPppoePrivate,
|
||||
service);
|
||||
service,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingPppoe:username:
|
||||
|
|
@ -269,7 +271,8 @@ nm_setting_pppoe_class_init(NMSettingPppoeClass *klass)
|
|||
PROP_USERNAME,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingPppoePrivate,
|
||||
username);
|
||||
username,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingPppoe:password:
|
||||
|
|
@ -282,7 +285,8 @@ nm_setting_pppoe_class_init(NMSettingPppoeClass *klass)
|
|||
PROP_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingPppoePrivate,
|
||||
password);
|
||||
password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingPppoe:password-flags:
|
||||
|
|
|
|||
|
|
@ -1048,6 +1048,7 @@ _nm_properties_override(GArray *properties_override, const NMSettInfoProperty *p
|
|||
&nm_sett_info_propert_type_direct_mac_address, \
|
||||
.direct_offset = \
|
||||
NM_STRUCT_OFFSET_ENSURE_TYPE(char *, private_struct_type, private_struct_field), \
|
||||
.direct_string_allow_empty = TRUE, \
|
||||
__VA_ARGS__); \
|
||||
} \
|
||||
G_STMT_END
|
||||
|
|
|
|||
|
|
@ -307,7 +307,8 @@ nm_setting_proxy_class_init(NMSettingProxyClass *klass)
|
|||
PROP_PAC_URL,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingProxyPrivate,
|
||||
pac_url);
|
||||
pac_url,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingProxy:pac-script:
|
||||
|
|
@ -339,7 +340,8 @@ nm_setting_proxy_class_init(NMSettingProxyClass *klass)
|
|||
PROP_PAC_SCRIPT,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingProxyPrivate,
|
||||
pac_script);
|
||||
pac_script,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -260,7 +260,8 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
|
|||
PROP_OWNER,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingTunPrivate,
|
||||
owner);
|
||||
owner,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingTun:group:
|
||||
|
|
@ -276,7 +277,8 @@ nm_setting_tun_class_init(NMSettingTunClass *klass)
|
|||
PROP_GROUP,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingTunPrivate,
|
||||
group);
|
||||
group,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingTun:pi:
|
||||
|
|
|
|||
|
|
@ -146,7 +146,8 @@ nm_setting_veth_class_init(NMSettingVethClass *klass)
|
|||
PROP_PEER,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingVeth,
|
||||
_priv.peer);
|
||||
_priv.peer,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
g_object_class_install_properties(object_class, _PROPERTY_ENUMS_LAST, obj_properties);
|
||||
|
||||
|
|
|
|||
|
|
@ -872,7 +872,8 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass)
|
|||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingVlanPrivate,
|
||||
parent);
|
||||
parent,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingVlan:id:
|
||||
|
|
@ -963,7 +964,8 @@ nm_setting_vlan_class_init(NMSettingVlanClass *klass)
|
|||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingVlanPrivate,
|
||||
protocol,
|
||||
.direct_string_is_refstr = TRUE);
|
||||
.direct_string_is_refstr = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingVlan:ingress-priority-map:
|
||||
|
|
|
|||
|
|
@ -1090,7 +1090,8 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
|
|||
PROP_SERVICE_TYPE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingVpnPrivate,
|
||||
service_type);
|
||||
service_type,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingVpn:user-name:
|
||||
|
|
@ -1108,7 +1109,8 @@ nm_setting_vpn_class_init(NMSettingVpnClass *klass)
|
|||
PROP_USER_NAME,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingVpnPrivate,
|
||||
user_name);
|
||||
user_name,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingVpn:persistent:
|
||||
|
|
|
|||
|
|
@ -444,7 +444,8 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||
PROP_PARENT,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingVxlanPrivate,
|
||||
parent);
|
||||
parent,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingVxlan:id:
|
||||
|
|
@ -480,7 +481,8 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||
NMSettingVxlanPrivate,
|
||||
local,
|
||||
.direct_set_string_ip_address_addr_family =
|
||||
AF_UNSPEC + 1);
|
||||
AF_UNSPEC + 1,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingVxlan:remote:
|
||||
|
|
@ -499,7 +501,8 @@ nm_setting_vxlan_class_init(NMSettingVxlanClass *klass)
|
|||
NMSettingVxlanPrivate,
|
||||
remote,
|
||||
.direct_set_string_ip_address_addr_family =
|
||||
AF_UNSPEC + 1);
|
||||
AF_UNSPEC + 1,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingVxlan:source-port-min:
|
||||
|
|
|
|||
|
|
@ -201,7 +201,8 @@ nm_setting_wifi_p2p_class_init(NMSettingWifiP2PClass *setting_wifi_p2p_class)
|
|||
PROP_PEER,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingWifiP2P,
|
||||
_priv.peer);
|
||||
_priv.peer,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWifiP2P:wps-method:
|
||||
|
|
|
|||
|
|
@ -175,7 +175,8 @@ nm_setting_wimax_class_init(NMSettingWimaxClass *klass)
|
|||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingWimaxPrivate,
|
||||
network_name,
|
||||
.is_deprecated = TRUE, );
|
||||
.is_deprecated = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWimax:mac-address:
|
||||
|
|
|
|||
|
|
@ -1203,7 +1203,8 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
PROP_PORT,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingWiredPrivate,
|
||||
port);
|
||||
port,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWired:speed:
|
||||
|
|
@ -1269,7 +1270,8 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
PROP_DUPLEX,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingWiredPrivate,
|
||||
duplex);
|
||||
duplex,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWired:auto-negotiate:
|
||||
|
|
@ -1458,7 +1460,8 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
PROP_GENERATE_MAC_ADDRESS_MASK,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
NMSettingWiredPrivate,
|
||||
generate_mac_address_mask);
|
||||
generate_mac_address_mask,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWired:mac-address-blacklist:
|
||||
|
|
@ -1556,7 +1559,8 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
PROP_S390_NETTYPE,
|
||||
NM_SETTING_PARAM_INFERRABLE,
|
||||
NMSettingWiredPrivate,
|
||||
s390_nettype);
|
||||
s390_nettype,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWired:s390-options: (type GHashTable(utf8,utf8))
|
||||
|
|
@ -1644,7 +1648,8 @@ nm_setting_wired_class_init(NMSettingWiredClass *klass)
|
|||
PROP_WAKE_ON_LAN_PASSWORD,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingWiredPrivate,
|
||||
wol_password);
|
||||
wol_password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWired:accept-all-mac-addresses:
|
||||
|
|
|
|||
|
|
@ -2363,7 +2363,8 @@ nm_setting_wireguard_class_init(NMSettingWireGuardClass *klass)
|
|||
NMSettingWireGuard,
|
||||
_priv.private_key,
|
||||
.direct_set_fcn.set_string =
|
||||
_set_string_fcn_public_key);
|
||||
_set_string_fcn_public_key,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWireGuard:private-key-flags:
|
||||
|
|
|
|||
|
|
@ -1420,7 +1420,8 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
NM_SETTING_PARAM_REQUIRED,
|
||||
NMSettingWirelessSecurityPrivate,
|
||||
key_mgmt,
|
||||
.direct_set_string_ascii_strdown = TRUE);
|
||||
.direct_set_string_ascii_strdown = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:wep-tx-keyidx:
|
||||
|
|
@ -1473,7 +1474,8 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingWirelessSecurityPrivate,
|
||||
auth_alg,
|
||||
.direct_set_string_ascii_strdown = TRUE);
|
||||
.direct_set_string_ascii_strdown = TRUE,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:proto:
|
||||
|
|
@ -1591,7 +1593,8 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
PROP_LEAP_USERNAME,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingWirelessSecurityPrivate,
|
||||
leap_username);
|
||||
leap_username,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:wep-key0:
|
||||
|
|
@ -1611,7 +1614,8 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
PROP_WEP_KEY0,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingWirelessSecurityPrivate,
|
||||
wep_key0);
|
||||
wep_key0,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:wep-key1:
|
||||
|
|
@ -1631,7 +1635,8 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
PROP_WEP_KEY1,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingWirelessSecurityPrivate,
|
||||
wep_key1);
|
||||
wep_key1,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:wep-key2:
|
||||
|
|
@ -1651,7 +1656,8 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
PROP_WEP_KEY2,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingWirelessSecurityPrivate,
|
||||
wep_key2);
|
||||
wep_key2,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:wep-key3:
|
||||
|
|
@ -1671,7 +1677,8 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
PROP_WEP_KEY3,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingWirelessSecurityPrivate,
|
||||
wep_key3);
|
||||
wep_key3,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:wep-key-flags:
|
||||
|
|
@ -1715,7 +1722,8 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
PROP_PSK,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingWirelessSecurityPrivate,
|
||||
psk);
|
||||
psk,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:psk-flags:
|
||||
|
|
@ -1757,7 +1765,8 @@ nm_setting_wireless_security_class_init(NMSettingWirelessSecurityClass *klass)
|
|||
PROP_LEAP_PASSWORD,
|
||||
NM_SETTING_PARAM_SECRET,
|
||||
NMSettingWirelessSecurityPrivate,
|
||||
leap_password);
|
||||
leap_password,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWirelessSecurity:leap-password-flags:
|
||||
|
|
|
|||
|
|
@ -1413,7 +1413,8 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||
PROP_MODE,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingWirelessPrivate,
|
||||
mode);
|
||||
mode,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWireless:band:
|
||||
|
|
@ -1440,7 +1441,8 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||
PROP_BAND,
|
||||
NM_SETTING_PARAM_NONE,
|
||||
NMSettingWirelessPrivate,
|
||||
band);
|
||||
band,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWireless:channel:
|
||||
|
|
@ -1707,7 +1709,8 @@ nm_setting_wireless_class_init(NMSettingWirelessClass *klass)
|
|||
PROP_GENERATE_MAC_ADDRESS_MASK,
|
||||
NM_SETTING_PARAM_FUZZY_IGNORE,
|
||||
NMSettingWirelessPrivate,
|
||||
generate_mac_address_mask);
|
||||
generate_mac_address_mask,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWireless:mac-address-blacklist:
|
||||
|
|
|
|||
|
|
@ -255,7 +255,8 @@ nm_setting_wpan_class_init(NMSettingWpanClass *klass)
|
|||
NMSettingWpanPrivate,
|
||||
mac_address,
|
||||
.direct_set_string_mac_address_len =
|
||||
IEEE802154_ADDR_LEN);
|
||||
IEEE802154_ADDR_LEN,
|
||||
.direct_string_allow_empty = TRUE);
|
||||
|
||||
/**
|
||||
* NMSettingWpan:pan-id:
|
||||
|
|
|
|||
|
|
@ -2429,8 +2429,27 @@ _verify_properties(NMSetting *setting, GError **error)
|
|||
case NM_VALUE_TYPE_NONE:
|
||||
case NM_VALUE_TYPE_UINT32:
|
||||
case NM_VALUE_TYPE_UINT64:
|
||||
case NM_VALUE_TYPE_STRING:
|
||||
break;
|
||||
case NM_VALUE_TYPE_STRING:
|
||||
{
|
||||
const char *val;
|
||||
|
||||
if (!property_info->direct_string_allow_empty
|
||||
&& (val = *((const char *const *)
|
||||
_nm_setting_get_private_field(setting, sett_info, property_info)))
|
||||
&& val[0] == '\0') {
|
||||
g_set_error_literal(error,
|
||||
NM_CONNECTION_ERROR,
|
||||
NM_CONNECTION_ERROR_INVALID_PROPERTY,
|
||||
_("cannot be empty"));
|
||||
g_prefix_error(error,
|
||||
"%s.%s: ",
|
||||
klass->setting_info->setting_name,
|
||||
property_info->name);
|
||||
return FALSE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
nm_assert_not_reached();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4740,6 +4740,15 @@ test_setting_metadata(void)
|
|||
}
|
||||
if (sip->direct_strv_preserve_empty)
|
||||
g_assert(sip->property_type->direct_type == NM_VALUE_TYPE_STRV);
|
||||
if (sip->direct_string_allow_empty) {
|
||||
g_assert(sip->property_type->direct_type == NM_VALUE_TYPE_STRING);
|
||||
}
|
||||
if (!sip->direct_string_allow_empty
|
||||
&& sip->property_type->direct_type == NM_VALUE_TYPE_STRING) {
|
||||
g_error("currently all properties must have this set: FAIL: %s.%s",
|
||||
nm_setting_get_name(setting),
|
||||
sip->name);
|
||||
}
|
||||
|
||||
if (sip->direct_set_string_mac_address_len != 0) {
|
||||
g_assert(NM_IN_SET(sip->property_type,
|
||||
|
|
|
|||
|
|
@ -839,6 +839,23 @@ struct _NMSettInfoProperty {
|
|||
/* Whether the string property is implemented as a (downcast) NMRefString. */
|
||||
bool direct_string_is_refstr : 1;
|
||||
|
||||
/* Usually, string properties cannot be empty (because it's unclear how
|
||||
* that relates to NULL and how to distinguish that in nmcli). In some
|
||||
* cases, it's allowed however (e.g. "gsm.apm").
|
||||
*
|
||||
* The lack of this flag indicates to perform an additional check after
|
||||
* verify(), that the string is not empty.
|
||||
*
|
||||
* In some cases, we can also normalize an empty value, in which case verify()
|
||||
* also allows the string to be empty.
|
||||
*
|
||||
* FIXME: historically, many properties allowed to be empty. Hence, to
|
||||
* preserve behavior this flag is also set for many properties where it
|
||||
* maybe should not be set. We should review the use of this flag and clear
|
||||
* it where possible. New properties generally should not allow empty
|
||||
* strings (unless they have specific reasons). */
|
||||
bool direct_string_allow_empty : 1;
|
||||
|
||||
/* Usually, for strv arrays (NM_VALUE_TYPE_STRV, NMValueStrv) there is little
|
||||
* difference between NULL/unset and empty arrays. E.g. g_object_get() will
|
||||
* return NULL and never an empty strv array.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue