Author: vlendec Date: 2005-12-19 21:07:42 +0000 (Mon, 19 Dec 2005) New Revision: 12369
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=12369 Log: We don't need to remove duplicate gids in getgrouplist_internals, later we use add_gid_to_list_unique anyway. Volker Modified: trunk/source/lib/system_smbd.c Changeset: Modified: trunk/source/lib/system_smbd.c =================================================================== --- trunk/source/lib/system_smbd.c 2005-12-19 21:02:14 UTC (rev 12368) +++ trunk/source/lib/system_smbd.c 2005-12-19 21:07:42 UTC (rev 12369) @@ -28,47 +28,6 @@ #ifndef HAVE_GETGROUPLIST -static int int_compare( int *a, int *b ) -{ - if ( *a == *b ) - return 0; - else if ( *a < *b ) - return -1; - else - return 1; -} - -void remove_duplicate_gids( int *num_groups, gid_t *groups ) -{ - int i; - int count = *num_groups; - - if ( *num_groups <= 0 || !groups ) - return; - - DEBUG(8,("remove_duplicate_gids: Enter %d gids\n", *num_groups)); - - qsort( groups, *num_groups, sizeof(gid_t), QSORT_CAST int_compare ); - - for ( i=1; i<count; ) { - if ( groups[i-1] == groups[i] ) { - memmove(&groups[i-1], &groups[i], (count - i + 1)*sizeof(gid_t)); - - /* decrement the total number of groups and do not increment - the loop counter */ - count--; - continue; - } - i++; - } - - *num_groups = count; - - DEBUG(8,("remove_duplicate_gids: Exit %d gids\n", *num_groups)); - - return; -} - /* This is a *much* faster way of getting the list of groups for a user without changing the current supplementary group list. The old @@ -141,9 +100,6 @@ } groups[0] = gid; *grpcnt = ret + 1; - - /* remove any duplicates gids in the list */ - remove_duplicate_gids( grpcnt, groups ); } restore_re_gid();
