summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2022-11-16 13:13:53 +0100
committerThomas Haller <thaller@redhat.com>2022-11-16 13:43:12 +0100
commit38f7ceafbaf74bad3f4c990da3120eb67d9dd4de (patch)
tree8254edf393c58e63badeb67b0623c668e27c3bc2
parent6f330a56bcd47460ac23fe52b391533eeb555c26 (diff)
downloadnetwork-manager-applet-38f7ceafbaf74bad3f4c990da3120eb67d9dd4de.tar.gz
c-e: workaround crash in required error for import
nm-vpnc crashes when passing no error argument, see [1]. Try with VPNC plugin installed: ./src/connection-editor/nm-connection-editor -i /some/invalid/file Workaround that. Also, libnm is going to work around that too ([2)]. But the bug should be fixed also for older libnm/plugin versions. [1] https://gitlab.gnome.org/GNOME/NetworkManager-vpnc/-/blob/c7d197477c94c5bae0396f0ef826db4d835e487d/properties/nm-vpnc-editor-plugin.c#L281 [2] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/3b2eb689f3da1e957216b6106382b9a46bae266f
-rw-r--r--src/connection-editor/connection-helpers.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/connection-editor/connection-helpers.c b/src/connection-editor/connection-helpers.c
index 0d29f20a..6ed85577 100644
--- a/src/connection-editor/connection-helpers.c
+++ b/src/connection-editor/connection-helpers.c
@@ -165,9 +165,21 @@ no_description:
NMConnection *
vpn_connection_from_file (const char *filename, GError **error)
{
+ gs_free_error GError *unused_error = NULL;
NMConnection *connection = NULL;
GSList *iter;
+ if (!error) {
+ /* Some VPN plugins crash when passing no error variable ([1]). Work
+ * around that. In the meantime, libnm does the same workaround ([2]).
+ *
+ *
+ * [1] https://gitlab.gnome.org/GNOME/NetworkManager-vpnc/-/blob/c7d197477c94c5bae0396f0ef826db4d835e487d/properties/nm-vpnc-editor-plugin.c#L281
+ * [2] https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/commit/3b2eb689f3da1e957216b6106382b9a46bae266f
+ */
+ error = &unused_error;
+ }
+
for (iter = vpn_get_plugin_infos (); !connection && iter; iter = iter->next) {
NMVpnEditorPlugin *plugin;