Second arg must be NULL when first arg is 0 (it is in all other places).
Bug report and patch from Hanno Böck <hanno@hboeck.de>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12747
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Apr 18 15:43:02 CEST 2017 on sn-devel-144
(cherry picked from commit
76b351e907f67cc7d4af4e7d800c7a3aa1269ee8)
Autobuild-User(v4-5-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-5-test): Thu Apr 20 16:36:14 CEST 2017 on sn-devel-144
static int get_current_groups(gid_t gid, uint32_t *p_ngroups, gid_t **p_groups)
{
int i;
- gid_t grp;
int ngroups;
gid_t *groups = NULL;
set_effective_gid(gid);
samba_setgid(gid);
- ngroups = sys_getgroups(0,&grp);
+ ngroups = sys_getgroups(0, NULL);
if (ngroups <= 0) {
goto fail;
}