mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
s3:auth: fix potential gap creation in wbcsids_to_samr_RidWithAttributeArray()
Pair-Programmed-With: Michael Adam <obnox@samba.org> metze
This commit is contained in:
parent
03c3a613c5
commit
adbab7710d
@ -519,7 +519,7 @@ static NTSTATUS wbcsids_to_samr_RidWithAttributeArray(
|
||||
const struct wbcSidWithAttr *sids,
|
||||
size_t num_sids)
|
||||
{
|
||||
unsigned int i;
|
||||
unsigned int i, j = 0;
|
||||
bool ok;
|
||||
|
||||
groups->rids = talloc_array(mem_ctx,
|
||||
@ -532,15 +532,16 @@ static NTSTATUS wbcsids_to_samr_RidWithAttributeArray(
|
||||
for (i = 0; i < num_sids; i++) {
|
||||
ok = sid_peek_check_rid(domain_sid,
|
||||
(const struct dom_sid *)&sids[i].sid,
|
||||
&groups->rids[i].rid);
|
||||
&groups->rids[j].rid);
|
||||
if (!ok) continue;
|
||||
|
||||
groups->rids[i].attributes = SE_GROUP_MANDATORY |
|
||||
groups->rids[j].attributes = SE_GROUP_MANDATORY |
|
||||
SE_GROUP_ENABLED_BY_DEFAULT |
|
||||
SE_GROUP_ENABLED;
|
||||
groups->count++;
|
||||
j++;
|
||||
}
|
||||
|
||||
groups->count = j;
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user