krb5 commit: Disable stdin buffering in libss dummy readline

Greg Hudson <[email protected]>
Newsgroups gmane.comp.encryption.kerberos.cvs
Message-ID <[email protected]>
https://github.com/krb5/krb5/commit/64eece071583f52b0eca8285848ab2746c14a769
commit 64eece071583f52b0eca8285848ab2746c14a769
Author: Greg Hudson <[email protected]>
Date:   Wed Oct 3 18:45:56 2018 -0400

    Disable stdin buffering in libss dummy readline
    
    readline() is careful not to read more bytes from fd 0 than it has to.
    Do the same in the dummy libss readline() by disabling stdin
    buffering.
    
    ticket: 8745

 src/util/ss/listen.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/util/ss/listen.c b/src/util/ss/listen.c
index c99caa3..879ebcf 100644
--- a/src/util/ss/listen.c
+++ b/src/util/ss/listen.c
@@ -33,6 +33,9 @@ static char *readline(const char *prompt)
     struct termios termbuf;
     char input[BUFSIZ];
 
+    /* Make sure we don't buffer anything beyond the line read. */
+    setvbuf(stdin, 0, _IONBF, 0);
+
     if (tcgetattr(STDIN_FILENO, &termbuf) == 0) {
         termbuf.c_lflag |= ICANON|ISIG|ECHO;
         tcsetattr(STDIN_FILENO, TCSANOW, &termbuf);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.