summaryrefslogtreecommitdiff
path: root/contrib/openpam/lib/libpam/openpam_ttyconv.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/openpam/lib/libpam/openpam_ttyconv.c')
-rw-r--r--contrib/openpam/lib/libpam/openpam_ttyconv.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/openpam/lib/libpam/openpam_ttyconv.c b/contrib/openpam/lib/libpam/openpam_ttyconv.c
index 8066b3b67298..1a50f1c99639 100644
--- a/contrib/openpam/lib/libpam/openpam_ttyconv.c
+++ b/contrib/openpam/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;