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



commit f5a5d0026262fff60a67dcd3226e435cef1e0fd0
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.

 nm-openconnect-service.conf                     |    7 ++++---
 src/nm-openconnect-service-openconnect-helper.c |    7 ++++++-
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/nm-openconnect-service.conf b/nm-openconnect-service.conf
index 8746c66..490e6ef 100644
--- a/nm-openconnect-service.conf
+++ b/nm-openconnect-service.conf
@@ -3,15 +3,16 @@
  "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd";>
 <busconfig>
        <policy user="root">
-               <allow own="org.freedesktop.NetworkManager.openconnect"/>
+               <allow own_prefix="org.freedesktop.NetworkManager.openconnect"/>
                <allow send_destination="org.freedesktop.NetworkManager.openconnect"/>
        </policy>
        <policy user="nm-openconnect">
-               <allow own="org.freedesktop.NetworkManager.openconnect"/>
+               <allow own_prefix="org.freedesktop.NetworkManager.openconnect"/>
                <allow send_destination="org.freedesktop.NetworkManager.openconnect"/>
+               <allow send_interface="org.freedesktop.NetworkManager.VPN.Plugin"/>
        </policy>
        <policy context="default">
-               <deny own="org.freedesktop.NetworkManager.openconnect"/>
+               <deny own_prefix="org.freedesktop.NetworkManager.openconnect"/>
                <deny send_destination="org.freedesktop.NetworkManager.openconnect"/>
        </policy>
 </busconfig>
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]