summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-02-13 09:27:56 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:48:08 -0500
commit08de05ce5a4da17403fc8feb2a1760ab21a767fa (patch)
tree61941064b2d42a3944d04a9ebe0646e1edb43f69
parente869883d801b79f4d13cf323b73a45fcd6d63492 (diff)
downloadsamba-08de05ce5a4da17403fc8feb2a1760ab21a767fa.tar.gz
samba-08de05ce5a4da17403fc8feb2a1760ab21a767fa.tar.bz2
samba-08de05ce5a4da17403fc8feb2a1760ab21a767fa.zip
r21307: make it possible to pass in NULL for domain or rid,
if someone isn't interessted in one of it metze (This used to be commit 1fdc71918a430c35af91fa7788e191d381f76d56)
-rw-r--r--source4/libcli/security/dom_sid.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/source4/libcli/security/dom_sid.c b/source4/libcli/security/dom_sid.c
index 54242eb515..a72588dee1 100644
--- a/source4/libcli/security/dom_sid.c
+++ b/source4/libcli/security/dom_sid.c
@@ -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;
}