lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1935 - nss-pam-ldapd-0.8/nslcd

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

nss-pam-ldapd commit: r1935 - nss-pam-ldapd-0.8/nslcd



Author: arthur
Date: Sat Feb 23 22:40:51 2013
New Revision: 1935
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1935&view=revision

Log:
extra sanity check to ensure not too many file descriptors are open 
(a9aea20f136026d6553295727350c88fe2431e0c from 0.9)

Modified:
   nss-pam-ldapd-0.8/nslcd/nslcd.c

Modified: nss-pam-ldapd-0.8/nslcd/nslcd.c
==============================================================================
--- nss-pam-ldapd-0.8/nslcd/nslcd.c     Sat Feb 23 22:23:53 2013        (r1934)
+++ nss-pam-ldapd-0.8/nslcd/nslcd.c     Sat Feb 23 22:40:51 2013        (r1935)
@@ -2,7 +2,7 @@
    nslcd.c - ldap local connection daemon
 
    Copyright (C) 2006 West Consulting
-   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Arthur de Jong
+   Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Arthur de Jong
 
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
@@ -114,7 +114,7 @@
 {
   fprintf(fp,"%s\n",PACKAGE_STRING);
   fprintf(fp,"Written by Luke Howard and Arthur de Jong.\n\n");
-  fprintf(fp,"Copyright (C) 1997-2012 Luke Howard, Arthur de Jong and West 
Consulting\n"
+  fprintf(fp,"Copyright (C) 1997-2013 Luke Howard, Arthur de Jong and West 
Consulting\n"
              "This is free software; see the source for copying conditions.  
There is NO\n"
              "warranty; not even for MERCHANTABILITY or FITNESS FOR A 
PARTICULAR PURPOSE.\n");
 }
@@ -299,6 +299,11 @@
     log_log(LOG_ERR,"cannot create socket: %s",strerror(errno));
     exit(EXIT_FAILURE);
   }
+  if (sock>=FD_SETSIZE)
+  {
+    log_log(LOG_ERR,"socket file descriptor number too high (%d)",sock);
+    exit(EXIT_FAILURE);
+  }
   /* remove existing named socket */
   if (unlink(filename)<0)
   {
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/