From: Ken Raeburn Date: Thu, 23 May 2002 00:52:00 +0000 (+0000) Subject: * krlogin.c (oob): Loop reading data until we actually reach the URG marker X-Git-Tag: krb5-1.3-alpha1~750 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f45edae0d227f2372a1b6529c590626720ee467a;p=krb5.git * krlogin.c (oob): Loop reading data until we actually reach the URG marker git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@14448 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index bbdf547dc..6c409afaa 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -1,3 +1,8 @@ +2002-05-22 Ken Raeburn + + * krlogin.c (oob): Loop reading data until we actually reach the + URG marker. + 2002-03-26 Ken Raeburn * defines.h (FAI_PREFIX): Don't define. diff --git a/src/appl/bsd/krlogin.c b/src/appl/bsd/krlogin.c index 783129897..c497dc2fb 100644 --- a/src/appl/bsd/krlogin.c +++ b/src/appl/bsd/krlogin.c @@ -1469,20 +1469,25 @@ int server_message(mark) void oob() { char mark; - char waste[RLOGIN_BUFSIZ]; - int atmark; + static char waste[RLOGIN_BUFSIZ]; + int atmark, n; mark = 0; recv(rem, &mark, 1, MSG_OOB); if (server_message(mark)) { - if (ioctl(rem, SIOCATMARK, &atmark) < 0) { - perror("ioctl"); - return; + for (;;) { + if (ioctl(rem, SIOCATMARK, &atmark) < 0) { + perror("ioctl"); + return; + } + if (atmark) + break; + n = read(rem, waste, sizeof (waste)); + if (n <= 0) + break; } - if (!atmark) - read(rem, waste, sizeof (waste)); } }