diff --git a/CREDITS b/CREDITS index b40c9d3b4826..a560f9e12c1f 100644 --- a/CREDITS +++ b/CREDITS @@ -18,6 +18,7 @@ ideas: Ankita Pal Baptiste Daroussin Brian Fundakowski Feldman + Brooks Davis Christos Zoulas Daniel Richard G. Darren J. Moffat diff --git a/lib/libpam/openpam_ttyconv.c b/lib/libpam/openpam_ttyconv.c index 8066b3b67298..1a50f1c99639 100644 --- a/lib/libpam/openpam_ttyconv.c +++ b/lib/libpam/openpam_ttyconv.c @@ -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;