dsdb: Split out construct_generic_token_groups() so we can reuse it
authorTim Beale <timbeale@catalyst.net.nz>
Wed, 4 Apr 2018 22:51:42 +0000 (10:51 +1200)
committerGarming Sam <garming@samba.org>
Fri, 11 May 2018 04:01:24 +0000 (06:01 +0200)
commit8a105af76c3d432505e0a503cd32feb3808df59a
tree4011af21d466b912f7ec3da13a1c09e21b3d204c
parentfcdb935e3749cab5bc7dcbb83414032c683640ef
dsdb: Split out construct_generic_token_groups() so we can reuse it

construct_generic_token_groups() currently works out the entire group
membership for a user, including the primaryGroupID. We want to do the
exact same thing for the msDS-ResultantPSO constructed attribute.
However, construct_generic_token_groups() currently adds the resulting
SIDs to the LDB search result, which we don't want to do for
msDS-ResultantPSO.

This patch splits the bulk of the group SID calculation work out into
a separate function that we can reuse for msDS-ResultantPSO. basically
this is just a straight move of the existing code. The only real change
is the TALLOC_CTX is renamed (tmp_ctx --> mem_ctx) and now passed into
the new function (so freeing it if an error conditions is hit is now
done in the caller).

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Tim Beale <timbeale@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/operational.c