1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

nwrap: Remove unneeded memcpy in getgrouplist()

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
This commit is contained in:
Andreas Schneider 2015-09-14 14:57:40 +02:00 committed by Michael Adam
parent a104389de2
commit 80abc70bc9

View File

@ -3561,8 +3561,7 @@ static int nwrap_getgrouplist(const char *user, gid_t group,
errno = ENOMEM;
return -1;
}
memcpy(groups_tmp, &group, sizeof(gid_t));
groups_tmp[0] = group;
nwrap_setgrent();
while ((grp = nwrap_getgrent()) != NULL) {
@ -3589,8 +3588,8 @@ static int nwrap_getgrouplist(const char *user, gid_t group,
errno = ENOMEM;
return -1;
}
groups_tmp[count] = grp->gr_gid;
memcpy(&groups_tmp[count], &grp->gr_gid, sizeof(gid_t));
count++;
}
}