1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-12 12:23:50 +03:00

r23566: Fix the sys_bsd_setgroups function. The actual workaround was inactive.

Michael
This commit is contained in:
Michael Adam
2007-06-21 14:23:06 +00:00
committed by Gerald (Jerry) Carter
parent 5456ea59ba
commit 4b5d9b2ba7

View File

@@ -1006,14 +1006,12 @@ static int sys_bsd_setgroups(gid_t primary_gid, int setlen, const gid_t *gidset)
* and insert it at the front. * and insert it at the front.
*/ */
if (gidset[0] != primary_gid) { if (gidset[0] != primary_gid) {
gid_t *new_gidset;
new_gidset = SMB_MALLOC_ARRAY(gid_t, setlen + 1); new_gidset = SMB_MALLOC_ARRAY(gid_t, setlen + 1);
if (new_gidset == NULL) { if (new_gidset == NULL) {
return -1; return -1;
} }
memcpy(new_gidset + 1, gidset, ((setlen + 1) * sizeof(gid_t))); memcpy(new_gidset + 1, gidset, (setlen * sizeof(gid_t)));
new_gidset[0] = primary_gid; new_gidset[0] = primary_gid;
setlen++; setlen++;
} }