char pppd_version[] = VERSION;
static char promptprog[PATH_MAX+1];
+static int promptprog_refused = 0;
static option_t options[] = {
{ "promptprog", o_string, promptprog,
int readgood, wstat;
ssize_t red;
- if (promptprog[0] == 0 || access(promptprog, X_OK) < 0)
+ if (promptprog_refused || promptprog[0] == 0 || access(promptprog, X_OK) < 0)
return -1; /* sorry, can't help */
if (!passwd)
passwd[readgood] = 0;
if (!WIFEXITED(wstat))
warn("%s terminated abnormally", promptprog);
- if (WEXITSTATUS(wstat))
- warn("%s exited with code %d", promptprog, WEXITSTATUS(status));
-
+ if (WEXITSTATUS(wstat)) {
+ warn("%s exited with code %d", promptprog, WEXITSTATUS(wstat));
+ /* code when cancel was hit in the prompt prog */
+ if (WEXITSTATUS(wstat) == 128) {
+ promptprog_refused = 1;
+ }
+ return -1;
+ }
return 1;
}