diff --git a/ChangeLog b/ChangeLog index 6315318bef..9badea4265 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-09-26 Dan Williams + + * libnm-glib/nm-vpn-plugin.c + - (impl_vpn_plugin_need_secrets): fix logic when no secrets are needed + 2007-09-26 Dan Williams * include/NetworkManagerVPN.h 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)) { - g_assert (sn); - *setting_name = g_strdup (sn); - ret = TRUE; - } else { - g_assert (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); + } else { + /* No secrets required */ + *setting_name = g_strdup (""); } out: