From: Daniel Lenski Date: Wed, 3 Feb 2021 07:29:14 +0000 (-0800) Subject: Fortinet: ignore 401/403 response to remote/index request X-Git-Tag: v8.20~325^2~28 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0ccef3de8613685702684d1143814ee7896f025b;p=users%2Fdwmw2%2Fopenconnect.git Fortinet: ignore 401/403 response to remote/index request Openfortivpn ignores the HTTP status code entirely in this request, and others. Testing shows that a 403 response here is routine and can be ignored. Signed-off-by: Daniel Lenski --- diff --git a/fortinet.c b/fortinet.c index c014fe96..126324e7 100644 --- a/fortinet.c +++ b/fortinet.c @@ -268,9 +268,13 @@ int fortinet_connect(struct openconnect_info *vpninfo) free(vpninfo->urlpath); vpninfo->urlpath = strdup("remote/index"); ret = do_https_request(vpninfo, "GET", NULL, NULL, &res_buf, 0); - if (ret < 0) + /* XXX: 401/403 is apparently normal and can be ignored (further + * evidence that this is vestigial, or at least not necessary for + * reconnect. + */ + if (ret < 0 && ret != -EPERM) goto out; - /* We don't care what it returned as long as it was successful */ + /* We don't care what it returned */ free(res_buf); res_buf = NULL;