Skip to content

Commit

Permalink
GP config: hush warning about unknown <quarantine>no</quarantine>
Browse files Browse the repository at this point in the history
Commit 958da82 ("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>
  • Loading branch information
dlenski authored and dwmw2 committed Apr 28, 2021
1 parent 35e3374 commit 806e679
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions gpst.c
Expand Up @@ -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;
Expand Down

0 comments on commit 806e679

Please sign in to comment.