summaryrefslogtreecommitdiff
path: root/source4/ldap_server
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mwallnoefer@yahoo.de>2010-02-21 11:56:12 +0100
committerAndrew Bartlett <abartlet@samba.org>2010-02-25 08:16:54 +1100
commit545889a048da0bc58c4a4db4500839ab050518fa (patch)
tree5134707ee8eea2b1d278bb71b694a30dab811e68 /source4/ldap_server
parent0efa8f4fbb3206512c69d74024c7a937ee035285 (diff)
downloadsamba-545889a048da0bc58c4a4db4500839ab050518fa.tar.gz
samba-545889a048da0bc58c4a4db4500839ab050518fa.tar.bz2
samba-545889a048da0bc58c4a4db4500839ab050518fa.zip
s4:LDAP server - Enable support for returning referrals through it
This is needed for my work regarding the referrals when the domain scope control isn't specified. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/ldap_server')
-rw-r--r--source4/ldap_server/ldap_backend.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index 689fd31141..1c5a2b2a04 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -475,6 +475,28 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
queue_reply:
ldapsrv_queue_reply(call, ent_r);
}
+
+ /* Send back referrals if they do exist (search operations) */
+ if (res->refs != NULL) {
+ char **ref;
+ struct ldap_SearchResRef *ent_ref;
+
+ for (ref = res->refs; *ref != NULL; ++ref) {
+ ent_r = ldapsrv_init_reply(call, LDAP_TAG_SearchResultReference);
+ NT_STATUS_HAVE_NO_MEMORY(ent_r);
+
+ /* Better to have the whole referrals kept here,
+ * than to find someone further up didn't put
+ * a value in the right spot in the talloc tree
+ */
+ talloc_steal(ent_r, *ref);
+
+ ent_ref = &ent_r->msg->r.SearchResultReference;
+ ent_ref->referral = *ref;
+
+ ldapsrv_queue_reply(call, ent_r);
+ }
+ }
}
reply: