diff options
author | Thomas Haller <thaller@redhat.com> | 2019-09-24 18:25:00 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-09-30 08:23:19 +0200 |
commit | 29a451d33a3630f034c9394ef376dc4887177bfe (patch) | |
tree | 58943bd6133d67bf1e8a9eceb0f162468c2e2cdb /libnm-core/nm-setting-vpn.c | |
parent | 5a5e08794e93e3ec250648b7765bdff67c671bce (diff) | |
download | NetworkManager-29a451d33a3630f034c9394ef376dc4887177bfe.tar.gz |
libnm: don't special case "vpn.secrets" property in property_to_dbus()
"nm-setting.c" (and property_to_dbus()) should stay independent of
actualy settings implementations. Instead, the property-info should
control the behavior.
What I like about this change is also that the generic handling is not a
flags "handle_secrets_for_vpn", but it just says to skip checking the
param-spec flags and directly call the to_dbus_fcn(). It's just a
generally useful thing to do, to let the to_dbus_fcn() function also
handle checking the property flags. The fact that only vpn.secrets
properties uses this for a certain pupose, is abstracted in a way that
makes sense.
Diffstat (limited to 'libnm-core/nm-setting-vpn.c')
-rw-r--r-- | libnm-core/nm-setting-vpn.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libnm-core/nm-setting-vpn.c b/libnm-core/nm-setting-vpn.c index 4adc0bc8ca..bc30f47641 100644 --- a/libnm-core/nm-setting-vpn.c +++ b/libnm-core/nm-setting-vpn.c @@ -921,6 +921,9 @@ vpn_secrets_to_dbus (const NMSettInfoSetting *sett_info, const char *key, *value; NMSettingSecretFlags secret_flags; + if (NM_FLAGS_HAS (flags, NM_CONNECTION_SERIALIZE_NO_SECRETS)) + return NULL; + g_variant_builder_init (&builder, G_VARIANT_TYPE ("a{ss}")); g_object_get (setting, property_name, &secrets, NULL); @@ -1150,6 +1153,7 @@ nm_setting_vpn_class_init (NMSettingVpnClass *klass) G_TYPE_HASH_TABLE, G_PARAM_READWRITE | NM_SETTING_PARAM_SECRET | + NM_SETTING_PARAM_TO_DBUS_IGNORE_FLAGS | G_PARAM_STATIC_STRINGS); _nm_properties_override_gobj (properties_override, obj_properties[PROP_SECRETS], |