summaryrefslogtreecommitdiff
path: root/source4/ldap_server/ldap_rootdse.c
diff options
context:
space:
mode:
Diffstat (limited to 'source4/ldap_server/ldap_rootdse.c')
-rw-r--r--source4/ldap_server/ldap_rootdse.c10
1 files changed, 9 insertions, 1 deletions
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;