[network-manager-openconnect] Fix up Juniper support



commit c69a180f1cbf35477a701fab5e528dea36a79ece
Author: David Woodhouse <David Woodhouse intel com>
Date:   Fri Jun 3 16:51:16 2016 +0100

    Fix up Juniper support

 auth-dialog/main.c |   24 +++++++++++-------------
 1 files changed, 11 insertions(+), 13 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index c40ad2c..68f297d 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -937,7 +937,6 @@ static int get_config (GHashTable *options, GHashTable *secrets,
        char *hostname;
        char *group;
        char *csd;
-       char *protocol;
        char *sslkey, *cert;
        char *csd_wrapper;
        char *pem_passphrase_fsid;
@@ -986,18 +985,6 @@ static int get_config (GHashTable *options, GHashTable *secrets,
                parse_xmlconfig (config_str);
        }
 
-       protocol = g_hash_table_lookup(options, NM_SETTING_VPN_SERVICE_TYPE);
-       if (protocol && g_str_has_prefix(protocol, NM_DBUS_SERVICE_OPENCONNECT ".")) {
-#if OPENCONNECT_CHECK_VER(5,2)
-               int ret = openconnect_set_protocol(vpninfo, protocol +
-                                 strlen(NM_DBUS_SERVICE_OPENCONENCT "."));
-               if (ret)
-                       return ret;
-#else
-               return -EINVAL;
-#endif
-       }
-
        cafile = g_hash_table_lookup (options, NM_OPENCONNECT_KEY_CACERT);
        if (cafile)
                openconnect_set_cafile(vpninfo, OC3DUP (cafile));
@@ -1656,6 +1643,17 @@ int main (int argc, char **argv)
                return 1;
        }
 
+       if (g_str_has_prefix(vpn_service, NM_VPN_SERVICE_TYPE_OPENCONNECT ".")) {
+               char *proto = vpn_service + strlen(NM_VPN_SERVICE_TYPE_OPENCONNECT ".");
+#if OPENCONNECT_CHECK_VER(5,1)
+               if (openconnect_set_protocol(_ui_data->vpninfo, proto))
+#endif
+               {
+                       fprintf (stderr, "Protocol '%s' not supported\n", proto);
+                       return 1;
+               }
+       }
+
 #if OPENCONNECT_CHECK_VER(3,4)
        openconnect_set_token_callbacks (_ui_data->vpninfo, _ui_data, NULL, update_token);
 #endif


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