From 806e6797d4203dedb444ef8b6ad17d9b5915039e Mon Sep 17 00:00:00 2001 From: Daniel Lenski Date: Tue, 27 Apr 2021 14:48:23 -0700 Subject: [PATCH] GP config: hush warning about unknown no Commit 958da82445d ("Warn if is set in GlobalProtect XML config") attempted to avoid emitting the warning for the value "no". But the way the condition was constructed, it left the "quarantine" node unhandled and triggered the later 'else' condition reporting it as an 'Unknown GlobalProtect config tag'. Fix it so that it really does silently ignore the "no" case. Signed-off-by: Daniel Lenski --- gpst.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gpst.c b/gpst.c index d5c42890..f8ab8441 100644 --- a/gpst.c +++ b/gpst.c @@ -379,11 +379,12 @@ static int gpst_parse_config_xml(struct openconnect_info *vpninfo, xmlNode *xml_ new_ip_info.mtu = atoi(s); else if (!xmlnode_get_val(xml_node, "lifetime", &s)) vpninfo->auth_expiration = time(NULL) + atol(s); - else if (!xmlnode_get_val(xml_node, "quarantine", &s) && strcmp(s, "no")) - vpn_progress(vpninfo, PRG_DEBUG, - _("WARNING: Config XML contains tag with value of \"%s\".\n" - " VPN connectivity may be disabled or limited.\n"), s); - else if (!xmlnode_get_val(xml_node, "disconnect-on-idle", &s)) { + else if (!xmlnode_get_val(xml_node, "quarantine", &s)) { + if (strcmp(s, "no")) + vpn_progress(vpninfo, PRG_DEBUG, + _("WARNING: Config XML contains tag with value of \"%s\".\n" + " VPN connectivity may be disabled or limited.\n"), s); + } else if (!xmlnode_get_val(xml_node, "disconnect-on-idle", &s)) { int sec = atoi(s); vpn_progress(vpninfo, PRG_INFO, _("Idle timeout is %d minutes.\n"), sec/60); vpninfo->idle_timeout = sec; -- 2.50.1