X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=pppd%2Fplugins%2Fpassprompt.c;h=babb6dc31bab6f1d71d1cabedfd844ba2a4d5158;hb=c78e3129d404f20d556f727ceee3704722de8cc7;hp=6c2c8284fd535c79384e0fb389f2198bfa54f665;hpb=c898e34da6dfcaa9172c04dc27c02b371b90391d;p=ppp.git diff --git a/pppd/plugins/passprompt.c b/pppd/plugins/passprompt.c index 6c2c828..babb6dc 100644 --- a/pppd/plugins/passprompt.c +++ b/pppd/plugins/passprompt.c @@ -50,7 +50,7 @@ static int promptpass(char *user, char *passwd) } if (!kid) { /* we are the child, exec the program */ - char *argv[4], fdstr[32]; + char *argv[5], fdstr[32]; sys_close(); closelog(); close(p[0]); @@ -74,13 +74,14 @@ static int promptpass(char *user, char *passwd) if (red == 0) break; if (red < 0) { + if (errno == EINTR) + continue; error("Can't read secret from %s: %m", promptprog); readgood = -1; break; } readgood += red; } while (readgood < MAXSECRETLEN - 1); - passwd[readgood] = 0; close(p[0]); /* now wait for child to exit */ @@ -93,6 +94,7 @@ static int promptpass(char *user, char *passwd) if (readgood < 0) return 0; + passwd[readgood] = 0; if (!WIFEXITED(wstat)) warn("%s terminated abnormally", promptprog); if (WEXITSTATUS(wstat))