/* get a group entry by name */ nss_status_t _nss_ldap_getgrnam_r( const char *name,struct group *result, char *buffer,size_t buflen,int *errnop) { NSS_BYNAME(NSLCD_ACTION_GROUP_BYNAME, name, read_group(fp,result,buffer,buflen,errnop)); } /* read a single group entry from the stream */ static nss_status_t read_group( TFILE *fp,struct group *result, char *buffer,size_t buflen,int *errnop) { int32_t tmpint32,tmp2int32,tmp3int32; size_t bufptr=0; memset(result,0,sizeof(struct group)); READ_BUF_STRING(fp,result->gr_name); READ_BUF_STRING(fp,result->gr_passwd); READ_TYPE(fp,result->gr_gid,gid_t); READ_BUF_STRINGLIST(fp,result->gr_mem); return NSS_STATUS_SUCCESS; } /* read an array from a stram and store it as a null-terminated array list (size for the array is allocated) */ #define READ_BUF_STRINGLIST(fp,arr) \ /* read the number of entries */ \ READ_TYPE(fp,tmp3int32,int32_t); \ DEBUG_PRINT("READ_STRLST: var="__STRING(arr)" num=%d",(int)tmp3int32); \ /* allocate room for *char[num+1] */ \ BUF_ALLOC(fp,arr,char *,tmp3int32+1); \ /* read all entries */ \ for (tmp2int32=0;tmp2int32