diff options
| author | Sebastien Bacher <seb128@ubuntu.com> | 2020-01-13 16:10:30 +0100 |
|---|---|---|
| committer | Sebastien Bacher <seb128@ubuntu.com> | 2020-01-13 16:31:40 +0100 |
| commit | 5a09f7759860f4f2a9bb01471ca8099cd705bc10 (patch) | |
| tree | 3a9cffc9622d53c9196771a1c7924bceb754f118 /libnm-core/nm-setting-vpn.c | |
| parent | 25691220fd27093630cf244e219b2f4f1f4e749e (diff) | |
| parent | ca847639aab94434daed120c874e1100c3d75dcf (diff) | |
Merge remote-tracking branch 'salsa/debian/master'
Diffstat (limited to 'libnm-core/nm-setting-vpn.c')
| -rw-r--r-- | libnm-core/nm-setting-vpn.c | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/libnm-core/nm-setting-vpn.c b/libnm-core/nm-setting-vpn.c index a011be77..05fca918 100644 --- a/libnm-core/nm-setting-vpn.c +++ b/libnm-core/nm-setting-vpn.c @@ -1,21 +1,7 @@ +// SPDX-License-Identifier: LGPL-2.1+ /* - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - * Boston, MA 02110-1301 USA. - * - * Copyright 2007 - 2013 Red Hat, Inc. - * Copyright 2007 - 2008 Novell, Inc. + * Copyright (C) 2007 - 2013 Red Hat, Inc. + * Copyright (C) 2007 - 2008 Novell, Inc. */ #include "nm-default.h" @@ -935,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); @@ -1143,12 +1132,7 @@ nm_setting_vpn_class_init (NMSettingVpnClass *klass) G_TYPE_HASH_TABLE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); - - _properties_override_add_transform (properties_override, - obj_properties[PROP_DATA], - G_VARIANT_TYPE ("a{ss}"), - _nm_utils_strdict_to_dbus, - _nm_utils_strdict_from_dbus); + _nm_properties_override_gobj (properties_override, obj_properties[PROP_DATA], &nm_sett_info_propert_type_strdict); /** * NMSettingVpn:secrets: (type GHashTable(utf8,utf8)): @@ -1169,14 +1153,15 @@ 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); - - _properties_override_add_override (properties_override, - obj_properties[PROP_SECRETS], - G_VARIANT_TYPE ("a{ss}"), - vpn_secrets_to_dbus, - vpn_secrets_from_dbus, - NULL); + _nm_properties_override_gobj (properties_override, + obj_properties[PROP_SECRETS], + NM_SETT_INFO_PROPERT_TYPE ( + .dbus_type = NM_G_VARIANT_TYPE ("a{ss}"), + .to_dbus_fcn = vpn_secrets_to_dbus, + .from_dbus_fcn = vpn_secrets_from_dbus, + )); /** * NMSettingVpn:timeout: |