]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Bugfix GP XML config: always include portal
authorDaniel Lenski <dlenski@gmail.com>
Sat, 30 Sep 2023 05:02:33 +0000 (22:02 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Sat, 30 Sep 2023 05:11:48 +0000 (22:11 -0700)
Ever since 8e7efd51f, the GlobalProtect *portal* has been included in the
newly-written XML config (`<ServerList>`) only if the portal config XML
contained a `<portal-name>` tag.

We should include the portal even if it doesn't have a name for itself.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
auth-globalprotect.c

index 4bf2514468d1aa2c6be4f4a4e2e6e1847a14564e..c9c232afc5e5f06cf5799bc59761fb233e149720 100644 (file)
@@ -534,14 +534,12 @@ no_gateways:
        if (vpninfo->write_new_config) {
                buf = buf_alloc();
                buf_append(buf, "<GPPortal>\n  <ServerList>\n");
-               if (portal) {
-                       buf_append(buf, "      <HostEntry><HostName>");
-                       buf_append_xmlescaped(buf, portal ? : _("unknown"));
-                       buf_append(buf, "</HostName><HostAddress>%s", vpninfo->hostname);
-                       if (vpninfo->port!=443)
-                               buf_append(buf, ":%d", vpninfo->port);
-                       buf_append(buf, "/global-protect</HostAddress></HostEntry>\n");
-               }
+               buf_append(buf, "      <HostEntry><HostName>");
+               buf_append_xmlescaped(buf, portal ? : _("unknown"));
+               buf_append(buf, "</HostName><HostAddress>%s", vpninfo->hostname);
+               if (vpninfo->port!=443)
+                       buf_append(buf, ":%d", vpninfo->port);
+               buf_append(buf, "/global-protect</HostAddress></HostEntry>\n");
        }
 
        /* first, count the number of gateways */