summaryrefslogtreecommitdiff
path: root/libnm-glib/nm-vpn-plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'libnm-glib/nm-vpn-plugin.c')
-rw-r--r--libnm-glib/nm-vpn-plugin.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/libnm-glib/nm-vpn-plugin.c b/libnm-glib/nm-vpn-plugin.c
index 4bf705760b..f89206b839 100644
--- a/libnm-glib/nm-vpn-plugin.c
+++ b/libnm-glib/nm-vpn-plugin.c
@@ -342,6 +342,7 @@ impl_vpn_plugin_need_secrets (NMVPNPlugin *plugin,
NMConnection *connection;
char *sn = NULL;
GError *ns_err = NULL;
+ gboolean needed = FALSE;
g_return_val_if_fail (NM_IS_VPN_PLUGIN (plugin), FALSE);
g_return_val_if_fail (properties != NULL, FALSE);
@@ -362,14 +363,20 @@ impl_vpn_plugin_need_secrets (NMVPNPlugin *plugin,
goto out;
}
- if (NM_VPN_PLUGIN_GET_CLASS (plugin)->need_secrets (plugin, connection, &sn, &ns_err)) {
+ needed = NM_VPN_PLUGIN_GET_CLASS (plugin)->need_secrets (plugin, connection, &sn, &ns_err);
+ if (ns_err) {
+ *err = g_error_copy (ns_err);
+ g_error_free (ns_err);
+ goto out;
+ }
+
+ ret = TRUE;
+ if (needed) {
g_assert (sn);
*setting_name = g_strdup (sn);
- ret = TRUE;
} else {
- g_assert (ns_err);
- *err = g_error_copy (ns_err);
- g_error_free (ns_err);
+ /* No secrets required */
+ *setting_name = g_strdup ("");
}
out: