summaryrefslogtreecommitdiffstats
path: root/source4/libcli/security
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-11-26 12:30:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:06:10 -0500
commit20c0900edbba66106d602f43262cb97a48c6cbe9 (patch)
treec6650cfd5432e0b2fadd58d9c41fab7b416fc1e9 /source4/libcli/security
parentb56d1c5cb7768a403f57c3a48e4dbd40978d3c79 (diff)
downloadsamba-20c0900edbba66106d602f43262cb97a48c6cbe9.tar.gz
samba-20c0900edbba66106d602f43262cb97a48c6cbe9.tar.xz
samba-20c0900edbba66106d602f43262cb97a48c6cbe9.zip
r3979: added server side code for lsa_LookupSids2() and fixed authority_name
return code to include our own domain. editing of ACLs via the w2k3 GUI works nicely (and faster) with these changes (This used to be commit a3f7f34b3965ddbd89b06334e03d2e1bb6aa364b)
Diffstat (limited to 'source4/libcli/security')
-rw-r--r--source4/libcli/security/dom_sid.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/source4/libcli/security/dom_sid.c b/source4/libcli/security/dom_sid.c
index 001618bb07..dbd03108e4 100644
--- a/source4/libcli/security/dom_sid.c
+++ b/source4/libcli/security/dom_sid.c
@@ -239,3 +239,29 @@ struct dom_sid *dom_sid_add_rid(TALLOC_CTX *mem_ctx,
sid->num_auths++;
return sid;
}
+
+
+/*
+ return True if the 2nd sid is in the domain given by the first sid
+*/
+BOOL dom_sid_in_domain(const struct dom_sid *domain_sid,
+ const struct dom_sid *sid)
+{
+ int i;
+
+ if (!domain_sid || !sid) {
+ return False;
+ }
+
+ if (domain_sid->num_auths > sid->num_auths) {
+ return False;
+ }
+
+ for (i = domain_sid->num_auths-1; i >= 0; --i) {
+ if (domain_sid->sub_auths[i] != sid->sub_auths[i]) {
+ return False;
+ }
+ }
+
+ return dom_sid_compare_auth(domain_sid, sid) == 0;
+}