1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

r21307: make it possible to pass in NULL for domain or rid,

if someone isn't interessted in one of it

metze
This commit is contained in:
Stefan Metzmacher 2007-02-13 09:27:56 +00:00 committed by Gerald (Jerry) Carter
parent 608d24f001
commit 1fdc71918a

View File

@ -225,12 +225,18 @@ NTSTATUS dom_sid_split_rid(TALLOC_CTX *mem_ctx, const struct dom_sid *sid,
return NT_STATUS_INVALID_PARAMETER;
}
if (!(*domain = dom_sid_dup(mem_ctx, sid))) {
return NT_STATUS_NO_MEMORY;
if (domain) {
if (!(*domain = dom_sid_dup(mem_ctx, sid))) {
return NT_STATUS_NO_MEMORY;
}
(*domain)->num_auths -= 1;
}
if (rid) {
*rid = sid->sub_auths[sid->num_auths - 1];
}
(*domain)->num_auths -= 1;
*rid = (*domain)->sub_auths[(*domain)->num_auths];
return NT_STATUS_OK;
}