summaryrefslogtreecommitdiff
path: root/source3/passdb/util_sam_sid.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2004-11-05 23:34:00 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:09 -0500
commit154d5f913b4ce60f731227eb1bb3650c45fcde93 (patch)
tree6dcd8538e9cc97c4d891082280055d8fe3c8366a /source3/passdb/util_sam_sid.c
parent55fe875a44bd63de766d4fbdb91bcc26be146a21 (diff)
downloadsamba-154d5f913b4ce60f731227eb1bb3650c45fcde93.tar.gz
samba-154d5f913b4ce60f731227eb1bb3650c45fcde93.tar.bz2
samba-154d5f913b4ce60f731227eb1bb3650c45fcde93.zip
r3566: Completely replace the queryuseraliases call. The previous implementation does
not exactly match what you would expect. XP workstations during login actually do this, so we should better become a bit more correct. The LDAP query issued is not really fully optimal, but it is a lot faster and more correct than what was there before. The change in passdb.h makes it possible that queryuseraliases is done with a single ldap query. Volker (This used to be commit 2508d4ed1e16c268fc9f3676b0c6a122e070f93d)
Diffstat (limited to 'source3/passdb/util_sam_sid.c')
-rw-r--r--source3/passdb/util_sam_sid.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/passdb/util_sam_sid.c b/source3/passdb/util_sam_sid.c
index c13159e47f..204f68c121 100644
--- a/source3/passdb/util_sam_sid.c
+++ b/source3/passdb/util_sam_sid.c
@@ -327,3 +327,16 @@ void add_sid_to_array(const DOM_SID *sid, DOM_SID **sids, int *num)
return;
}
+
+
+void add_sid_to_array_unique(const DOM_SID *sid, DOM_SID **sids, int *num_sids)
+{
+ int i;
+
+ for (i=0; i<(*num_sids); i++) {
+ if (sid_compare(sid, &(*sids)[i]) == 0)
+ return;
+ }
+
+ return add_sid_to_array(sid, sids, num_sids);
+}