Merge upstream r948: fix race condition in openpam_ttyconv(3).
This commit is contained in:
commit
a90c7d9aa8
@ -18,6 +18,7 @@ ideas:
|
||||
Ankita Pal <pal.ankita.ankita@gmail.com>
|
||||
Baptiste Daroussin <bapt@freebsd.org>
|
||||
Brian Fundakowski Feldman <green@freebsd.org>
|
||||
Brooks Davis <brooks@freebsd.org>
|
||||
Christos Zoulas <christos@netbsd.org>
|
||||
Daniel Richard G. <skunk@iskunk.org>
|
||||
Darren J. Moffat <darren.moffat@sun.com>
|
||||
|
@ -94,12 +94,6 @@ prompt_tty(int ifd, int ofd, const char *message, char *response, int echo)
|
||||
int pos, ret;
|
||||
char ch;
|
||||
|
||||
/* write prompt */
|
||||
if (write(ofd, message, strlen(message)) < 0) {
|
||||
openpam_log(PAM_LOG_ERROR, "write(): %m");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* turn echo off if requested */
|
||||
slflag = 0; /* prevent bogus uninitialized variable warning */
|
||||
if (!echo) {
|
||||
@ -115,6 +109,12 @@ prompt_tty(int ifd, int ofd, const char *message, char *response, int echo)
|
||||
}
|
||||
}
|
||||
|
||||
/* write prompt */
|
||||
if (write(ofd, message, strlen(message)) < 0) {
|
||||
openpam_log(PAM_LOG_ERROR, "write(): %m");
|
||||
return (-1);
|
||||
}
|
||||
|
||||
/* install signal handlers */
|
||||
caught_signal = 0;
|
||||
action.sa_handler = &catch_signal;
|
||||
|
Loading…
Reference in New Issue
Block a user