[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#690319: lookup fail to contact nslcd when first 1024 filedescriptor are already used (select)



Hi,

I noticed (by chance) there is a problem with the squeeze-security patch
for #690319;  it introduces a regression on kfreebsd and has not built.
 I'm not sure where to find build logs of this, or if they are public,
but I think it is due to using a non-standard EBADFD errno ("file
descriptor in bad state").

Perhaps EBADF ("is not a valid file descriptor" / "bad file number")
would be suitable instead and is more portable;  please consider
attached bug690319-amend-1.diff

Alternatively we could #define EBADFD EBADF on platforms that don't have
it;  please see bug690319-amend-2.diff if that is preferred.

Thanks,
Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
--- nss-pam-ldapd-0.7.15+squeeze3/common/tio.c.orig	2013-02-12 21:03:06.000000000 +0000
+++ nss-pam-ldapd-0.7.15+squeeze3/common/tio.c	2013-05-01 22:45:22.752734366 +0100
@@ -185,7 +185,7 @@
     /* prepare our filedescriptorset */
     if (fp->fd>=FD_SETSIZE)
     {
-      errno=EBADFD;
+      errno=EBADF;
       return -1;
     }
     FD_ZERO(&fdset);
@@ -397,7 +397,7 @@
   /* prepare our filedescriptorset */
   if (fp->fd>=FD_SETSIZE)
   {
-    errno=EBADFD;
+    errno=EBADF;
     return -1;
   }
   FD_ZERO(&fdset);
--- nss-pam-ldapd-0.7.15+squeeze3/common/tio.c.orig	2013-02-12 21:03:06.000000000 +0000
+++ nss-pam-ldapd-0.7.15+squeeze3/common/tio.c	2013-05-01 22:46:58.205740782 +0100
@@ -42,6 +42,11 @@
 #define ETIME ETIMEDOUT
 #endif /* ETIME */
 
+/* for platforms that don't have EBADFD use EBADF */
+#ifndef EBADFD
+#define EBADFD EBADF
+#endif /* EBADFD */
+
 /* structure that holds a buffer
    the buffer contains the data that is between the application and the
    file descriptor that is used for efficient transfer

Reply to: