[PATCH] Append vpninfo->urlpath to <group-access>

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some ASA gateways may need the relative path specified in <group-access> XML
entry so it makes sense to verify if it exists and append it.

Signed-off-by: Murilo Opsfelder Araujo <muriloo at linux.vnet.ibm.com>
---
 auth.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/auth.c b/auth.c
index 5acd04b..f28e350 100644
--- a/auth.c
+++ b/auth.c
@@ -780,11 +780,17 @@ int xmlpost_initial_req(struct openconnect_info *vpninfo, char *request_body, in
 	xmlNodePtr root, node;
 	xmlDocPtr doc = xmlpost_new_query(vpninfo, "init", &root);
 	char *url;
+	int result;
 
 	if (!doc)
 		return -ENOMEM;
 
-	if (asprintf(&url, "https://%s";, vpninfo->hostname) == -1)
+	if (vpninfo->urlpath)
+		result = asprintf(&url, "https://%s/%s";, vpninfo->hostname, vpninfo->urlpath);
+	else
+		result = asprintf(&url, "https://%s";, vpninfo->hostname);
+
+	if (result == -1)
 		goto bad;
 	node = xmlNewTextChild(root, NULL, XCAST("group-access"), XCAST(url));
 	free(url);
-- 
1.8.4.273.ga194ead




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux