[30300] in CVS-changelog-for-Kerberos-V5

home help back first fref pref prev next nref lref last post

krb5 commit: Disable stdin buffering in libss dummy readline

daemon@ATHENA.MIT.EDU (Greg Hudson)
Thu Oct 4 12:41:28 2018

Date: Thu, 4 Oct 2018 12:36:02 -0400
From: Greg Hudson <ghudson@mit.edu>
Message-Id: <201810041636.w94Ga2AW025042@drugstore.mit.edu>
To: cvs-krb5@mit.edu
Reply-To: krbdev@mit.edu
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Errors-To: cvs-krb5-bounces@mit.edu

https://github.com/krb5/krb5/commit/64eece071583f52b0eca8285848ab2746c14a769
commit 64eece071583f52b0eca8285848ab2746c14a769
Author: Greg Hudson <ghudson@mit.edu>
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);
_______________________________________________
cvs-krb5 mailing list
cvs-krb5@mit.edu
https://mailman.mit.edu/mailman/listinfo/cvs-krb5

home help back first fref pref prev next nref lref last post