[krbdev.mit.edu #6317] AutoReply: select(2) if no fds < FD_SETSIZE are available.

Roland C. Dowdeswell via RT rt-comment at krbdev.mit.edu
Wed Apr 22 00:34:53 EDT 2009


On 1231362354 seconds since the Beginning of the UNIX epoch
"krb5" wrote:
>

>	2.  increase the limit to DESIRED_FD_SETSIZE which I define
>	    to be 8192.

Apparently, to do this, one must also modify kdc/network.c to have
the same FD_SETSIZE because it calls krb5int_cm_call_select().
This is a little counter-intuitive as the function is defined in
a file called sendto_kdc.c and is marked internal.

A patch is attached.  This patch is suboptimal because one should
either remove the dependency on krb5int_cm_call_select() or centrally
define the FD_SETSIZE in another header which is included quite
early.  cm.h is not included early enough and putting this sort of
logic in there does not work.

--
    Roland Dowdeswell                      http://Imrryr.ORG/~elric/

Index: kdc/network.c
===================================================================
RCS file: /ms/dev/kerberos/mitkrb5/cvs-dirs/mitkrb5-1.4/mitkrb5/src/kdc/network.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -u -r1.8 -r1.9
--- kdc/network.c	1 Apr 2008 21:09:02 -0000	1.8
+++ kdc/network.c	11 Mar 2009 17:05:10 -0000	1.9
@@ -26,6 +26,25 @@
  * Network code for Kerberos v5 KDC.
  */
 
+/*
+ * We start out by upping the size of FD_SETSIZE.  On rational operating
+ * systems, this is simple.  One simply #defines FD_SETSIZE before including
+ * anything else.  Linux of course does not support this because they are
+ * better than that.  So, we special case things...
+ */
+
+#define DESIRED_FD_SETSIZE     8192
+#ifndef linux
+#define FD_SETSIZE     DESIRED_FD_SETSIZE
+#else
+#include <features.h>
+#if (__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)
+#include <bits/types.h>
+#undef __FD_SETSIZE
+#define __FD_SETSIZE DESIRED_FD_SETSIZE
+#endif
+#endif
+
 #define NEED_SOCKETS
 #include "k5-int.h"
 #include "com_err.h"





More information about the krb5-bugs mailing list