summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-04-19 19:55:38 +0200
committerLubomir Rintel <lkundrak@v3.sk>2016-04-20 10:50:08 +0200
commit843a05f7cc95f864bb898f670cb6adbdf813dfce (patch)
tree1396a1315d7903145a0a9c070a876fc5fa11680c
parent745d22f08eac7add0f09f48b18bc44f4b89af11b (diff)
downloadNetworkManager-843a05f7cc95f864bb898f670cb6adbdf813dfce.tar.gz
libnm/vpn-service-plugin: don't register a bus name before creating the VPN object
Otherwise NetworkManager can be too fast calling a method: <error> [1461073999.2362] vpn-connection[0x7fe39ec491e0,be049803-a705-438f-b8f5-49db87640c93,"libreswan",0]: plugin NeedSecrets request #1 failed: No such interface 'org.freedesktop.NetworkManager.VPN.Plugin' on object at path /org/freedesktop/NetworkManager/VPN/Plugin
-rw-r--r--libnm/nm-vpn-service-plugin.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/libnm/nm-vpn-service-plugin.c b/libnm/nm-vpn-service-plugin.c
index 82e29ee8a3..bf4369e4ad 100644
--- a/libnm/nm-vpn-service-plugin.c
+++ b/libnm/nm-vpn-service-plugin.c
@@ -994,19 +994,6 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
if (!proxy)
goto out;
- ret = g_dbus_proxy_call_sync (proxy,
- "RequestName",
- g_variant_new ("(su)", priv->dbus_service_name, 0),
- G_DBUS_CALL_FLAGS_NONE, -1,
- cancellable, error);
- g_object_unref (proxy);
- if (!ret) {
- if (error && *error)
- g_dbus_error_strip_remote_error (*error);
- goto out;
- }
- g_variant_unref (ret);
-
priv->dbus_vpn_service_plugin = nmdbus_vpn_plugin_skeleton_new ();
if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (priv->dbus_vpn_service_plugin),
connection,
@@ -1030,6 +1017,19 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
nm_vpn_service_plugin_set_connection (plugin, connection);
nm_vpn_service_plugin_set_state (plugin, NM_VPN_SERVICE_STATE_INIT);
+ ret = g_dbus_proxy_call_sync (proxy,
+ "RequestName",
+ g_variant_new ("(su)", priv->dbus_service_name, 0),
+ G_DBUS_CALL_FLAGS_NONE, -1,
+ cancellable, error);
+ g_object_unref (proxy);
+ if (!ret) {
+ if (error && *error)
+ g_dbus_error_strip_remote_error (*error);
+ goto out;
+ }
+ g_variant_unref (ret);
+
success = TRUE;
out: