[PATCH] Fix --os=win

Antonio Borneo borneo.antonio at gmail.com
Sat Dec 7 23:29:32 EST 2013


Running OpenConnect with flag "--os=win" we get
        vpninfo->csd_xmltag == "csd"
In fact, in library.c we have:
     85         else if (!strcmp(os, "win"))
     86                 vpninfo->csd_xmltag = "csd";

In current code, the case (vpninfo->csd_xmltag == "csd") is
grabbed by previous "else if()" condition and not evaluated
anymore to extract "stuburl", "starturl" and "waiturl".

Split the "else if" in independent statement.

Signed-off-by: Antonio Borneo <borneo.antonio at gmail.com>
---
 auth.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/auth.c b/auth.c
index f28e350..9336b29 100644
--- a/auth.c
+++ b/auth.c
@@ -454,7 +454,8 @@ static int parse_auth_node(struct openconnect_info *vpninfo, xmlNode *xml_node,
 		} else if (!vpninfo->csd_scriptname && xmlnode_is_named(xml_node, "csd")) {
 			xmlnode_get_prop(xml_node, "token", &vpninfo->csd_token);
 			xmlnode_get_prop(xml_node, "ticket", &vpninfo->csd_ticket);
-		} else if (!vpninfo->csd_scriptname && xmlnode_is_named(xml_node, vpninfo->csd_xmltag)) {
+		}
+		if (!vpninfo->csd_scriptname && xmlnode_is_named(xml_node, vpninfo->csd_xmltag)) {
 			xmlnode_get_prop(xml_node, "stuburl", &vpninfo->csd_stuburl);
 			xmlnode_get_prop(xml_node, "starturl", &vpninfo->csd_starturl);
 			xmlnode_get_prop(xml_node, "waiturl", &vpninfo->csd_waiturl);
-- 
1.7.3.4




More information about the openconnect-devel mailing list