]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
GP config: hush warning about unknown <quarantine>no</quarantine>
authorDaniel Lenski <dlenski@gmail.com>
Tue, 27 Apr 2021 21:48:23 +0000 (14:48 -0700)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 28 Apr 2021 10:15:39 +0000 (11:15 +0100)
Commit 958da82445d ("Warn if <quarantine> 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 <dlenski@gmail.com>
gpst.c

diff --git a/gpst.c b/gpst.c
index d5c428907f47e01b6e741d71397b8ba4a0aa3284..f8ab8441444d51b720a8a8c881191cc2b1c5e254 100644 (file)
--- 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 <quarantine> 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 <quarantine> 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;