select_opt = NULL;
continue;
}
+ if (non_inter) {
+ vpn_progress(vpninfo, PRG_ERR,
+ _("User input required in non-interactive mode\n"));
+ return -EINVAL;
+ }
printf("%s [", opt->label);
for (i = 0; i < select_opt->nr_choices; i++) {
choice = &select_opt->choices[i];
opt->value = strdup(vpninfo->username);
if (!opt->value)
return -ENOMEM;
+ } else if (non_inter) {
+ vpn_progress(vpninfo, PRG_ERR,
+ _("User input required in non-interactive mode\n"));
+ return -EINVAL;
} else {
opt->value=malloc(80);
if (!opt->value)
} else if (opt->type == OC_FORM_OPT_PASSWORD) {
if (vpninfo->password &&
!strcmp(opt->name, "password")) {
- opt->value = strdup(vpninfo->password);
+ opt->value = vpninfo->password;
vpninfo->password = NULL;
if (!opt->value)
return -ENOMEM;
+ } else if (non_inter) {
+ vpn_progress(vpninfo, PRG_ERR,
+ _("User input required in non-interactive mode\n"));
+ return -EINVAL;
} else {
struct termios t;
opt->value=malloc(80);