]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
juniper: Support 'username' form input type
authorFrançois Grenier <francois@pacof.net>
Fri, 13 Jan 2017 01:25:12 +0000 (20:25 -0500)
committerDavid Woodhouse <dwmw2@infradead.org>
Wed, 13 Dec 2017 14:48:57 +0000 (14:48 +0000)
https://bugzilla.redhat.com/show_bug.cgi?id=1412021

Signed-off-by: François Grenier <francois@pacof.net>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
auth-juniper.c

index 4b889d6b8f3baf51fc1b11cf0ef73c1375ae0ce4..eee85d2fcf6e5f4d12bb2b4cd12150222bc18c78 100644 (file)
@@ -122,6 +122,13 @@ static int parse_input_node(struct openconnect_info *vpninfo, struct oc_auth_for
                        ret = -ENOMEM;
                        goto out;
                }
+       } else if (!strcasecmp(type, "username")) {
+               opt->type = OC_FORM_OPT_TEXT;
+               xmlnode_get_prop(node, "name", &opt->name);
+               if (asprintf(&opt->label, "%s:", opt->name) == -1) {
+                       ret = -ENOMEM;
+                       goto out;
+               }
        } else if (!strcasecmp(type, "submit")) {
                xmlnode_get_prop(node, "name", &opt->name);
                if (opt->name && (!strcmp(opt->name, submit_button) ||