From 9a7c87bb645d908fab4527824376e328f4f3b0e0 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 22 Sep 2004 14:16:42 +0000 Subject: r2527: - add a dummy for a simple ldb backend - handle the complete rootDSE search (maybe this will be also a partition module) metze (This used to be commit 6fc904a71cf5305d0c5c260ad1665499ea6c6f9a) --- source4/ldap_server/ldap_rootdse.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source4/ldap_server/ldap_rootdse.c') diff --git a/source4/ldap_server/ldap_rootdse.c b/source4/ldap_server/ldap_rootdse.c index 75e641648b..b1d889e830 100644 --- a/source4/ldap_server/ldap_rootdse.c +++ b/source4/ldap_server/ldap_rootdse.c @@ -32,12 +32,18 @@ void ldapsrv_RootDSE_Search(struct ldapsrv_call *call, { struct ldap_SearchResEntry *ent; struct ldap_Result *done; + int code = 0; struct ldapsrv_reply *ent_r, *done_r; int num_attrs = 3; struct ldap_attribute *attrs; DEBUG(10, ("Root DSE: %s\n", r->filter)); + if (r->scope != LDAP_SEARCH_SCOPE_BASE) { + code = 32; /* nosuchobject */ + goto no_base_scope; + } + attrs = talloc_array_p(call, struct ldap_attribute, num_attrs); if (!attrs) { ldapsrv_terminate_connection(call->conn, "no memory"); @@ -233,6 +239,8 @@ void ldapsrv_RootDSE_Search(struct ldapsrv_call *call, ldapsrv_queue_reply(call, ent_r); +no_base_scope: + done_r = ldapsrv_init_reply(call, LDAP_TAG_SearchResultDone); if (!done_r) { ldapsrv_terminate_connection(call->conn, "ldapsrv_init_reply() failed"); @@ -240,7 +248,7 @@ void ldapsrv_RootDSE_Search(struct ldapsrv_call *call, } done = &done_r->msg.r.SearchResultDone; - done->resultcode = 0; + done->resultcode = code; done->dn = NULL; done->errormessage = NULL; done->referral = NULL; -- cgit