lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1809 - nss-pam-ldapd/nss

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

nss-pam-ldapd commit: r1809 - nss-pam-ldapd/nss



Author: arthur
Date: Fri Oct 26 13:51:05 2012
New Revision: 1809
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1809&view=revision

Log:
fix buffer size checking in group by member NSS function on Solaris

Modified:
   nss-pam-ldapd/nss/group.c

Modified: nss-pam-ldapd/nss/group.c
==============================================================================
--- nss-pam-ldapd/nss/group.c   Fri Oct 26 13:48:29 2012        (r1808)
+++ nss-pam-ldapd/nss/group.c   Fri Oct 26 13:51:05 2012        (r1809)
@@ -73,11 +73,11 @@
     /* only add the group to the list if it is not the specified group */
     if (gid!=skipgroup)
     {
+#ifdef NSS_FLAVOUR_GLIBC
       /* check if we reached the limit */
       if ( (limit>0) && (*start>=limit) )
         return NSS_STATUS_TRYAGAIN;
       /* check if our buffer is large enough */
-#ifdef NSS_FLAVOUR_GLIBC
       if ((*start)>=(*size))
       {
         /* for some reason Glibc expects us to grow the array (completely
@@ -94,6 +94,14 @@
         *size=newsize;
       }
 #endif /* NSS_FLAVOUR_GLIBC */
+#ifdef NSS_FLAVOUR_SOLARIS
+      /* check if we reached the limit */
+      if ( (limit>0) && (*start>=limit) )
+      {
+        errnop=1; /* this is args->ergange */
+        return NSS_STATUS_NOTFOUND;
+      }
+#endif /* NSS_FLAVOUR_SOLARIS */
       /* add gid to list */
       (*groupsp)[(*start)++]=gid;
     }
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/