[network-manager-openconnect/lr/multiple-vpn: 4/5] helper: make it possible to make helper speak to a different bus.



commit 5ac8d98904074a95d2eb20962ba1c8da93023dce
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Tue Oct 13 19:23:31 2015 +0200

    helper: make it possible to make helper speak to a different bus.

 src/nm-openconnect-service-openconnect-helper.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/src/nm-openconnect-service-openconnect-helper.c b/src/nm-openconnect-service-openconnect-helper.c
index 30e0ead..af2534d 100644
--- a/src/nm-openconnect-service-openconnect-helper.c
+++ b/src/nm-openconnect-service-openconnect-helper.c
@@ -395,6 +395,7 @@ main (int argc, char *argv[])
        GVariant *val;
        GError *err = NULL;
        struct in_addr temp_addr;
+       char *bus_path;
 
 #if !GLIB_CHECK_VERSION (2, 35, 0)
        g_type_init ();
@@ -407,10 +408,14 @@ main (int argc, char *argv[])
        if (tmp && strcmp (tmp, "connect") != 0)
                exit (0);
 
+       bus_path = getenv ("NM_DBUS_SERVICE_OPENCONNECT");
+       if (!bus_path)
+               bus_path = NM_DBUS_SERVICE_OPENCONNECT;
+
        proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
                                               G_DBUS_PROXY_FLAGS_NONE,
                                               NULL,
-                                              NM_DBUS_SERVICE_OPENCONNECT,
+                                              bus_path,
                                               NM_VPN_DBUS_PLUGIN_PATH,
                                               NM_VPN_DBUS_PLUGIN_INTERFACE,
                                               NULL, &err);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]