Changeset 948 in openpam


Ignore:
Timestamp:
Nov 19, 2020, 5:41:15 AM (2 weeks ago)
Author:
Dag-Erling Smørgrav
Message:

In openpam_ttyconv(3), wait to print the prompt until after we're ready
to accept input. Otherwise, there is a small but non-zero chance that
input provided after the prompt appears is discarded when we flush the
tty buffer.

Submitted by: Brooks Davis <brooks@…>

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/CREDITS

    r943 r948  
    1919        Baptiste Daroussin <bapt@freebsd.org>
    2020        Brian Fundakowski Feldman <green@freebsd.org>
     21        Brooks Davis <brooks@freebsd.org>
    2122        Christos Zoulas <christos@netbsd.org>
    2223        Daniel Richard G. <skunk@iskunk.org>
  • trunk/HISTORY

    r945 r948  
     1OpenPAM ???                                                     2020-07-??
     2
     3 - BUGFIX: Fix race condition in openpam_ttyconv(3) when used with
     4   expect scripts.
     5============================================================================
    16OpenPAM Tabebuia                                                2019-02-24
    27
  • trunk/lib/libpam/openpam_ttyconv.c

    r938 r948  
    9595        char ch;
    9696
    97         /* write prompt */
    98         if (write(ofd, message, strlen(message)) < 0) {
    99                 openpam_log(PAM_LOG_ERROR, "write(): %m");
    100                 return (-1);
    101         }
    102 
    10397        /* turn echo off if requested */
    10498        slflag = 0; /* prevent bogus uninitialized variable warning */
     
    114108                        return (-1);
    115109                }
     110        }
     111
     112        /* write prompt */
     113        if (write(ofd, message, strlen(message)) < 0) {
     114                openpam_log(PAM_LOG_ERROR, "write(): %m");
     115                return (-1);
    116116        }
    117117
Note: See TracChangeset for help on using the changeset viewer.