diff options
| author | Jeremy Bicha <jeremy.bicha@canonical.com> | 2022-11-28 16:28:37 -0500 |
|---|---|---|
| committer | Jeremy Bicha <jeremy.bicha@canonical.com> | 2022-11-28 16:28:52 -0500 |
| commit | 23b72b08c0e0079ce1c6e6daa5b2a95602290cf3 (patch) | |
| tree | 423b7ab020011c905b18e4706558537d01758b8e /src/libnm-core-impl/nm-vpn-editor-plugin.c | |
| parent | 54a11b421d2f5e43f9c88eb38a0a5992e9636290 (diff) | |
| parent | dbc388c3d1132f291cf4d62455d77e71d0918dcc (diff) | |
Merge tag 'debian/1.40.4-1' into ubuntu/master
network-manager Debian release 1.40.4-1
Diffstat (limited to 'src/libnm-core-impl/nm-vpn-editor-plugin.c')
| -rw-r--r-- | src/libnm-core-impl/nm-vpn-editor-plugin.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libnm-core-impl/nm-vpn-editor-plugin.c b/src/libnm-core-impl/nm-vpn-editor-plugin.c index 225f25ef..3a6abbc2 100644 --- a/src/libnm-core-impl/nm-vpn-editor-plugin.c +++ b/src/libnm-core-impl/nm-vpn-editor-plugin.c @@ -470,8 +470,20 @@ nm_vpn_editor_plugin_import(NMVpnEditorPlugin *plugin, const char *path, GError g_return_val_if_fail(NM_IS_VPN_EDITOR_PLUGIN(plugin), NULL); if (nm_vpn_editor_plugin_get_capabilities(plugin) & NM_VPN_EDITOR_PLUGIN_CAPABILITY_IMPORT) { + gs_free_error GError *error2 = NULL; + g_return_val_if_fail(NM_VPN_EDITOR_PLUGIN_GET_INTERFACE(plugin)->import_from_file != NULL, NULL); + + if (!error) { + /* Some VPN plugins crash if error argument is omitted. Work around that + * in libnm by always requesting an error. + * + * https://gitlab.gnome.org/GNOME/NetworkManager-vpnc/-/blob/c7d197477c94c5bae0396f0ef826db4d835e487d/properties/nm-vpnc-editor-plugin.c#L281 + **/ + error = &error2; + } + return NM_VPN_EDITOR_PLUGIN_GET_INTERFACE(plugin)->import_from_file(plugin, path, error); } |