diff options
author | Dan Williams <dcbw@redhat.com> | 2007-09-27 03:03:09 +0000 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2007-09-27 03:03:09 +0000 |
commit | 6e47b9a49585f61795820d1f763c6b5a39bd5200 (patch) | |
tree | b3af38e1fc555ad856626d28210c4705b0165870 /libnm-glib/nm-vpn-plugin.c | |
parent | 00b8633a3e58810db94a83496c3d48c8a60ede7b (diff) | |
download | NetworkManager-6e47b9a49585f61795820d1f763c6b5a39bd5200.tar.gz |
2007-09-26 Dan Williams <dcbw@redhat.com>
* libnm-glib/nm-vpn-plugin.c
- (impl_vpn_plugin_need_secrets): fix logic when no secrets are needed
git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2896 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
Diffstat (limited to 'libnm-glib/nm-vpn-plugin.c')
-rw-r--r-- | libnm-glib/nm-vpn-plugin.c | 17 |
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: |