lists.arthurdejong.org
RSS feed

nss-pam-ldapd commit: r1749 - nss-pam-ldapd/nss

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

nss-pam-ldapd commit: r1749 - nss-pam-ldapd/nss



Author: arthur
Date: Mon Sep  3 23:15:28 2012
New Revision: 1749
URL: http://arthurdejong.org/viewvc/nss-pam-ldapd?revision=1749&view=revision

Log:
a few fixes in the Solaris group lookups

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

Modified: nss-pam-ldapd/nss/group.c
==============================================================================
--- nss-pam-ldapd/nss/group.c   Mon Sep  3 23:07:56 2012        (r1748)
+++ nss-pam-ldapd/nss/group.c   Mon Sep  3 23:15:28 2012        (r1749)
@@ -190,7 +190,6 @@
   struct group result;
   nss_status_t retv;
   char *buffer;
-  size_t buflen;
   int i;
   /* read the group into a temporary buffer */
   buffer=(char *)malloc(args->buf.buflen);
@@ -210,12 +209,12 @@
     for (i=0;result.gr_mem[i];i++)
     {
       if (i)
-        
strncat(args->buf.buffer,args->buf.buflen-strlen(args->buf.buffer)-1,",");
-      
strncat(args->buf.buffer,args->buf.buflen-strlen(args->buf.buffer)-1,result.gr_mem[i]);
+        
strncat(args->buf.buffer,",",args->buf.buflen-strlen(args->buf.buffer)-1);
+      
strncat(args->buf.buffer,result.gr_mem[i],args->buf.buflen-strlen(args->buf.buffer)-1);
     }
   free(buffer);
   /* check if buffer overflowed */
-  if (strlen(args->buf.buffer)>=args->buf.buffer-1)
+  if (strlen(args->buf.buffer)>=args->buf.buflen-1)
     return NSS_STATUS_TRYAGAIN;
   NSS_ARGS(args)->returnval=NSS_ARGS(args)->buf.buffer;
   NSS_ARGS(args)->returnlen=strlen(NSS_ARGS(args)->buf.buffer);
-- 
To unsubscribe send an email to
nss-pam-ldapd-commits-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-commits/