Skip to content

Commit

Permalink
Merge branch 'fix_authgroup_dropdown_handling' of gitlab.com:dlenski/…
Browse files Browse the repository at this point in the history
…openconnect
  • Loading branch information
dwmw2 committed Oct 8, 2018
2 parents 9c8778b + 7224312 commit f90a56d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion auth-globalprotect.c
Expand Up @@ -401,6 +401,8 @@ static int parse_portal_xml(struct openconnect_info *vpninfo, xmlNode *xml_node,
choice->label, choice->name);
}
}
if (!vpninfo->authgroup && opt->nr_choices)
vpninfo->authgroup = strdup(opt->choices[0]->name);

if (vpninfo->write_new_config) {
buf_append(buf, " </ServerList>\n</GPPortal>\n");
Expand All @@ -412,7 +414,7 @@ static int parse_portal_xml(struct openconnect_info *vpninfo, xmlNode *xml_node,

/* process auth form to select gateway */
result = process_auth_form(vpninfo, form);
if (result != OC_FORM_RESULT_NEWGROUP)
if (result == OC_FORM_RESULT_CANCELLED || result < 0)
goto out;

/* redirect to the gateway (no-op if it's the same host) */
Expand Down
4 changes: 2 additions & 2 deletions library.c
Expand Up @@ -1107,9 +1107,9 @@ int process_auth_form(struct openconnect_info *vpninfo, struct oc_auth_form *for

retry:
auth_choice = NULL;
if (grp && grp->nr_choices && !vpninfo->xmlpost) {
if (grp && grp->nr_choices) {
/* Set group selection from authgroup */
if (vpninfo->authgroup) {
/* For non-XML-POST, the server doesn't tell us which group is selected */
int i;
for (i = 0; i < grp->nr_choices; i++)
if (!strcmp(grp->choices[i]->name, vpninfo->authgroup))
Expand Down

0 comments on commit f90a56d

Please sign in to comment.