diff options
Diffstat (limited to 'lib/libpam/openpam_ttyconv.c')
-rw-r--r-- | lib/libpam/openpam_ttyconv.c | 12 |
1 files changed, 6 insertions, 6 deletions
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; |