diff options
| author | Michael Biebl <biebl@debian.org> | 2022-12-03 22:59:09 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2022-12-03 22:59:09 +0100 |
| commit | 06356c8ac470c1fa46f881b0598ec48a653e69ae (patch) | |
| tree | 42e7714b4caedf4d23ebefd42d8d0afebc6f3569 /src/libnm-core-impl/nm-vpn-editor-plugin.c | |
| parent | 78ecd0c8a4a337e38470f3fae5db74daf61ba86a (diff) | |
| parent | 372b62c2c25eb1f2e811f84849e9b69c40ae6245 (diff) | |
Merge branch 'debian/master' into debian/bullseye-backports
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); } |