From b17783@achilles.ctd.anl.gov Mon Mar 31 15:09:56 1997
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id PAA28705 for <bugs@RT-11.MIT.EDU>; Mon, 31 Mar 1997 15:09:55 -0500
Received: from [146.137.72.1] by MIT.EDU with SMTP
id AA12661; Mon, 31 Mar 97 15:08:11 EST
Received: from pembroke.ctd.anl.gov (pembroke.ctd.anl.gov [146.137.64.73]) by achilles.ctd.anl.gov (8.6.11/8.6.11) with ESMTP id OAA09479; Mon, 31 Mar 1997 14:07:55 -0600
Received: (b17783@localhost) by pembroke.ctd.anl.gov (8.6.11/8.6.11) id OAA31616; Mon, 31 Mar 1997 14:07:53 -0600
Message-Id: <199703312007.OAA31616@pembroke.ctd.anl.gov>
Date: Mon, 31 Mar 1997 14:07:53 -0600
From: deengert@anl.gov
Reply-To: deengert@anl.gov
To: krb5-bugs@MIT.EDU
Cc: deengert@anl.gov
Subject: Using non-blocking I/O on Windows, Win95, NT
X-Send-Pr-Version: 3.99
Douglas E. Engert <DEEngert@anl.gov>
Argonne National Laboratory
9700 South Cass Avenue
Argonne, Illinois 60439
(630) 252-5444
Windows, Windows, Windows NT
System: AIX pembroke 1 4 000300234600
and will fail if a socket is set to non-blocking. The comments
in the code "/* XXX must not use non-blocking I/O */" indicate
that this is something which should be fixed.
This it very important when using Kerberos in a Windows
environment, where an application may pass on open socket
which is set to non-blocking to a Krb5 routine, such as
sendauth.
The attached fix was designed and tested using Windows 95,
(32-bit) were the read would fail without the change. The fix to
net_write.c was added for completness, but I did not see a
failure, since the test case did not overrun the output buffer.
This could could be reworked to work in a UNIX environment
as well.
*** net_read.c.orig Mon Mar 31 13:34:09 1997
--- net_read.c.dee Mon Mar 31 13:42:09 1997
***************
*** 51,56 ****
--- 51,71 ----
if (SOCKET_ERRNO == SOCKET_EINTR)
continue;
#if defined(_MSDOS) || (_WIN32)
+ /* check for non-blocking, and take action
+ * this includes doing a select and let the
+ * calling aplication's blocking hook routines
+ * or the winsock blocking hook routine
+ * dispatch other messages - DEE
+ */
+ if (SOCKET_ERRNO == WSAEWOULDBLOCK) {
+ fd_set fdset;
+
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ cc = select(0, &fdset, NULL, NULL, NULL);
+ if (cc != SOCKET_ERROR)
+ continue;
+ }
/* XXX this interface sucks! */
errno = SOCKET_ERRNO;
#endif
*** net_write.c.orig Mon Mar 31 13:34:24 1997
--- net_write.c.dee Mon Mar 31 13:42:22 1997
***************
*** 50,55 ****
--- 50,71 ----
if (SOCKET_ERRNO == SOCKET_EINTR)
continue;
#if defined(_MSDOS) || (_WIN32)
+ /* check for non-blocking, and take action
+ * this includes doing a select and let the
+ * calling aplication's blocking hook routines
+ * or the winsock blocking hook routine
+ * dispatch other messages - DEE
+ */
+ if (SOCKET_ERRNO == WSAEWOULDBLOCK) {
+ fd_set fdset;
+
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ cc = select(0, NULL, &fdset, NULL, NULL);
+ if (cc != SOCKET_ERROR)
+ continue;
+ }
+
/* XXX this interface sucks! */
errno = SOCKET_ERRNO;
K5-1.0 is unable to use non-blocking I/O
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id PAA28705 for <bugs@RT-11.MIT.EDU>; Mon, 31 Mar 1997 15:09:55 -0500
Received: from [146.137.72.1] by MIT.EDU with SMTP
id AA12661; Mon, 31 Mar 97 15:08:11 EST
Received: from pembroke.ctd.anl.gov (pembroke.ctd.anl.gov [146.137.64.73]) by achilles.ctd.anl.gov (8.6.11/8.6.11) with ESMTP id OAA09479; Mon, 31 Mar 1997 14:07:55 -0600
Received: (b17783@localhost) by pembroke.ctd.anl.gov (8.6.11/8.6.11) id OAA31616; Mon, 31 Mar 1997 14:07:53 -0600
Message-Id: <199703312007.OAA31616@pembroke.ctd.anl.gov>
Date: Mon, 31 Mar 1997 14:07:53 -0600
From: deengert@anl.gov
Reply-To: deengert@anl.gov
To: krb5-bugs@MIT.EDU
Cc: deengert@anl.gov
Subject: Using non-blocking I/O on Windows, Win95, NT
X-Send-Pr-Version: 3.99
Show quoted text
>Number: 408
>Category: krb5-libs
>Synopsis: Using non-blocking I/O on Windows, Win95, NT
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: krb5-unassigned
>State: open
>Class: change-request
>Submitter-Id: unknown
>Arrival-Date: Mon Mar 31 15:10:01 EST 1997
>Last-Modified: Fri Sep 14 10:31:24 EDT 2001
>Originator: Douglas E. Engert
>Organization:
>Category: krb5-libs
>Synopsis: Using non-blocking I/O on Windows, Win95, NT
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: krb5-unassigned
>State: open
>Class: change-request
>Submitter-Id: unknown
>Arrival-Date: Mon Mar 31 15:10:01 EST 1997
>Last-Modified: Fri Sep 14 10:31:24 EDT 2001
>Originator: Douglas E. Engert
>Organization:
Douglas E. Engert <DEEngert@anl.gov>
Argonne National Laboratory
9700 South Cass Avenue
Argonne, Illinois 60439
(630) 252-5444
Show quoted text
>Release: 1.0
>Environment:
>Environment:
Windows, Windows, Windows NT
System: AIX pembroke 1 4 000300234600
Show quoted text
>Description:
net_read.c and net_write.c both expect to use blocking I/O,and will fail if a socket is set to non-blocking. The comments
in the code "/* XXX must not use non-blocking I/O */" indicate
that this is something which should be fixed.
This it very important when using Kerberos in a Windows
environment, where an application may pass on open socket
which is set to non-blocking to a Krb5 routine, such as
sendauth.
Show quoted text
>How-To-Repeat:
Show quoted text
>Fix:
The attached fix was designed and tested using Windows 95,
(32-bit) were the read would fail without the change. The fix to
net_write.c was added for completness, but I did not see a
failure, since the test case did not overrun the output buffer.
This could could be reworked to work in a UNIX environment
as well.
*** net_read.c.orig Mon Mar 31 13:34:09 1997
--- net_read.c.dee Mon Mar 31 13:42:09 1997
***************
*** 51,56 ****
--- 51,71 ----
if (SOCKET_ERRNO == SOCKET_EINTR)
continue;
#if defined(_MSDOS) || (_WIN32)
+ /* check for non-blocking, and take action
+ * this includes doing a select and let the
+ * calling aplication's blocking hook routines
+ * or the winsock blocking hook routine
+ * dispatch other messages - DEE
+ */
+ if (SOCKET_ERRNO == WSAEWOULDBLOCK) {
+ fd_set fdset;
+
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ cc = select(0, &fdset, NULL, NULL, NULL);
+ if (cc != SOCKET_ERROR)
+ continue;
+ }
/* XXX this interface sucks! */
errno = SOCKET_ERRNO;
#endif
*** net_write.c.orig Mon Mar 31 13:34:24 1997
--- net_write.c.dee Mon Mar 31 13:42:22 1997
***************
*** 50,55 ****
--- 50,71 ----
if (SOCKET_ERRNO == SOCKET_EINTR)
continue;
#if defined(_MSDOS) || (_WIN32)
+ /* check for non-blocking, and take action
+ * this includes doing a select and let the
+ * calling aplication's blocking hook routines
+ * or the winsock blocking hook routine
+ * dispatch other messages - DEE
+ */
+ if (SOCKET_ERRNO == WSAEWOULDBLOCK) {
+ fd_set fdset;
+
+ FD_ZERO(&fdset);
+ FD_SET(fd, &fdset);
+ cc = select(0, NULL, &fdset, NULL, NULL);
+ if (cc != SOCKET_ERROR)
+ continue;
+ }
+
/* XXX this interface sucks! */
errno = SOCKET_ERRNO;
Show quoted text
>Audit-Trail:
>Unformatted:
>Unformatted:
K5-1.0 is unable to use non-blocking I/O