Moved the calls to checkpasswd() out of the getparameter() function
which allows for any related arguments to be specified on the command
line before or after --user (and --proxy-user).
For example: --bearer doesn't need to be specified before --user to
prevent curl from asking for an unnecessary password as is the case
with commit
e7dcc454c67a2f.
}
break;
case 'u':
- /* user:password */
+ /* user:password;options */
GetStr(&config->userpwd, nextarg);
cleanarg(nextarg);
- if(!config->xoauth2_bearer) {
- err = checkpasswd("host", &config->userpwd);
- if(err)
- return err;
- }
break;
case 'U':
/* Proxy user:password */
GetStr(&config->proxyuserpwd, nextarg);
cleanarg(nextarg);
- err = checkpasswd("proxy", &config->proxyuserpwd);
- if(err)
- return err;
break;
case 'v':
if(toggle) {
}
}
+ if(config->userpwd && !config->xoauth2_bearer) {
+ res = checkpasswd("host", &config->userpwd);
+ if(res)
+ goto quit_curl;
+ }
+
+ if(config->proxyuserpwd) {
+ res = checkpasswd("proxy", &config->proxyuserpwd);
+ if(res)
+ goto quit_curl;
+ }
+
if((!config->url_list || !config->url_list->url) && !config->list_engines) {
helpf(config->errors, "no URL specified!\n");
res = CURLE_FAILED_INIT;