mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 13:40:20 +01:00
libnm: assert in _nm_setting_aggregate() that we handle secret-flags
Curreently all aggregate types only care about secrets. The check for secets is done by checking for NM_SETTING_PARAM_SECRET flag. Assert that this check is suitable to identify a secret.
This commit is contained in:
parent
885c872d5a
commit
d61cfc1774
1 changed files with 9 additions and 4 deletions
|
|
@ -1779,14 +1779,19 @@ _nm_setting_aggregate (NMSetting *setting,
|
|||
|
||||
sett_info = _nm_sett_info_setting_get (NM_SETTING_GET_CLASS (setting));
|
||||
for (i = 0; i < sett_info->property_infos_len; i++) {
|
||||
GParamSpec *prop_spec = sett_info->property_infos[i].param_spec;
|
||||
const NMSettInfoProperty *property_info = &sett_info->property_infos[i];
|
||||
GParamSpec *prop_spec = property_info->param_spec;
|
||||
nm_auto_unset_gvalue GValue value = G_VALUE_INIT;
|
||||
NMSettingSecretFlags secret_flags;
|
||||
|
||||
if (!prop_spec)
|
||||
continue;
|
||||
if (!NM_FLAGS_HAS (prop_spec->flags, NM_SETTING_PARAM_SECRET))
|
||||
if ( !prop_spec
|
||||
|| !NM_FLAGS_HAS (prop_spec->flags, NM_SETTING_PARAM_SECRET)) {
|
||||
nm_assert (!nm_setting_get_secret_flags (setting, property_info->name, NULL, NULL));
|
||||
continue;
|
||||
}
|
||||
|
||||
/* for the moment, all aggregate types only care about secrets. */
|
||||
nm_assert (nm_setting_get_secret_flags (setting, property_info->name, NULL, NULL));
|
||||
|
||||
switch (type) {
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue