From: Daniel Lenski Date: Tue, 15 Aug 2017 04:32:02 +0000 (-0700) Subject: detect user[name], pass[word] form fields using only the first 4 characters X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9569ecdd57866cec309e48ef7bbb5ee51dfe1e0d;p=users%2Fdwmw2%2Fopenconnect.git detect user[name], pass[word] form fields using only the first 4 characters The current process_auth_form_cb hard-codes the interpretation of these form fields based on their names. GlobalProtect has identical fields but with slightly different names. Signed-off-by: Daniel Lenski Signed-off-by: David Woodhouse --- diff --git a/main.c b/main.c index 935147f4..6f1bbad4 100644 --- a/main.c +++ b/main.c @@ -1974,7 +1974,7 @@ static int process_auth_form_cb(void *_vpninfo, } else if (opt->type == OC_FORM_OPT_TEXT) { if (username && - !strcmp(opt->name, "username")) { + !strncmp(opt->name, "user", 4)) { opt->_value = username; username = NULL; } else { @@ -1987,7 +1987,7 @@ static int process_auth_form_cb(void *_vpninfo, } else if (opt->type == OC_FORM_OPT_PASSWORD) { if (password && - !strcmp(opt->name, "password")) { + !strncmp(opt->name, "pass", 4)) { opt->_value = password; password = NULL; } else {