summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2003-12-19 04:13:39 +0000
committerAndrew Tridgell <tridge@samba.org>2003-12-19 04:13:39 +0000
commit98e66d04491f5d1035b5164027658e638fec8629 (patch)
treec951658e7174a2c975ef5a6829049ae0497a8213 /source4/librpc/ndr
parentdb22c0c5f94ecc12339efbd3950fe1c5648fde76 (diff)
downloadsamba-98e66d04491f5d1035b5164027658e638fec8629.tar.gz
samba-98e66d04491f5d1035b5164027658e638fec8629.tar.bz2
samba-98e66d04491f5d1035b5164027658e638fec8629.zip
fixed the AddAliasMem test code
(This used to be commit abe7ffcece5fcb75b0cf5633dd5871fa3e3c1723)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r--source4/librpc/ndr/ndr_sec.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/source4/librpc/ndr/ndr_sec.c b/source4/librpc/ndr/ndr_sec.c
index 1a8d355149..a3be697c49 100644
--- a/source4/librpc/ndr/ndr_sec.c
+++ b/source4/librpc/ndr/ndr_sec.c
@@ -138,3 +138,26 @@ size_t ndr_size_security_descriptor(struct security_descriptor *sd)
ret += ndr_size_security_acl(sd->sacl);
return ret;
}
+
+/*
+ add a rid to a domain dom_sid to make a full dom_sid
+*/
+struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx,
+ const struct dom_sid *domain_sid,
+ uint32 rid)
+{
+ struct dom_sid *sid;
+
+ sid = talloc_p(mem_ctx, struct dom_sid);
+ if (!sid) return NULL;
+
+ *sid = *domain_sid;
+ sid->sub_auths = talloc_array_p(mem_ctx, uint32, sid->num_auths+1);
+ if (!sid->sub_auths) {
+ return NULL;
+ }
+ memcpy(sid->sub_auths, domain_sid->sub_auths, sid->num_auths*sizeof(uint32));
+ sid->sub_auths[sid->num_auths] = rid;
+ sid->num_auths++;
+ return sid;
+}