diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-10-10 02:24:42 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:59:43 -0500 |
commit | 22f0d7012ce8393201ab0dbcc0bb958f94f1b563 (patch) | |
tree | e1372670ddda925c1c2bc7070eab5f45e1b8af81 /source4 | |
parent | 437a037b7bf7335a24290ce4252b22b631c6dda0 (diff) | |
download | samba-22f0d7012ce8393201ab0dbcc0bb958f94f1b563.tar.gz samba-22f0d7012ce8393201ab0dbcc0bb958f94f1b563.tar.bz2 samba-22f0d7012ce8393201ab0dbcc0bb958f94f1b563.zip |
r2891: call rootDSE only with LDAP_SEARCH_SCOPE_BASE
this is needed because of the global catalog
metze
(This used to be commit 071c19c25df92e87355ce6efb5eb7ce7694cf09b)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/ldap_server/ldap_backend.c | 17 | ||||
-rw-r--r-- | source4/ldap_server/ldap_rootdse.c | 3 |
2 files changed, 10 insertions, 10 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c index f62657e579..03df64f922 100644 --- a/source4/ldap_server/ldap_backend.c +++ b/source4/ldap_server/ldap_backend.c @@ -45,9 +45,10 @@ NTSTATUS ldapsrv_queue_reply(struct ldapsrv_call *call, struct ldapsrv_reply *re return NT_STATUS_OK; } -struct ldapsrv_partition *ldapsrv_get_partition(struct ldapsrv_connection *conn, const char *dn) +struct ldapsrv_partition *ldapsrv_get_partition(struct ldapsrv_connection *conn, const char *dn, enum ldap_scope scope) { - if (strcasecmp("", dn) == 0) { + if (scope == LDAP_SEARCH_SCOPE_BASE + && strcasecmp("", dn) == 0) { return conn->service->rootDSE; } @@ -87,7 +88,7 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call) DEBUGADD(10, (" basedn: %s", req->basedn)); DEBUGADD(10, (" filter: %s\n", req->filter)); - part = ldapsrv_get_partition(call->conn, req->basedn); + part = ldapsrv_get_partition(call->conn, req->basedn, req->scope); if (!part->ops->Search) { struct ldap_Result *done; @@ -118,7 +119,7 @@ static NTSTATUS ldapsrv_ModifyRequest(struct ldapsrv_call *call) DEBUG(10, ("ModifyRequest")); DEBUGADD(10, (" dn: %s", req->dn)); - part = ldapsrv_get_partition(call->conn, req->dn); + part = ldapsrv_get_partition(call->conn, req->dn, LDAP_SEARCH_SCOPE_SUB); if (!part->ops->Modify) { return ldapsrv_unwilling(call, 53); @@ -135,7 +136,7 @@ static NTSTATUS ldapsrv_AddRequest(struct ldapsrv_call *call) DEBUG(10, ("AddRequest")); DEBUGADD(10, (" dn: %s", req->dn)); - part = ldapsrv_get_partition(call->conn, req->dn); + part = ldapsrv_get_partition(call->conn, req->dn, LDAP_SEARCH_SCOPE_SUB); if (!part->ops->Add) { return ldapsrv_unwilling(call, 53); @@ -152,7 +153,7 @@ static NTSTATUS ldapsrv_DelRequest(struct ldapsrv_call *call) DEBUG(10, ("DelRequest")); DEBUGADD(10, (" dn: %s", req->dn)); - part = ldapsrv_get_partition(call->conn, req->dn); + part = ldapsrv_get_partition(call->conn, req->dn, LDAP_SEARCH_SCOPE_SUB); if (!part->ops->Del) { return ldapsrv_unwilling(call, 53); @@ -170,7 +171,7 @@ static NTSTATUS ldapsrv_ModifyDNRequest(struct ldapsrv_call *call) DEBUGADD(10, (" dn: %s", req->dn)); DEBUGADD(10, (" newrdn: %s", req->newrdn)); - part = ldapsrv_get_partition(call->conn, req->dn); + part = ldapsrv_get_partition(call->conn, req->dn, LDAP_SEARCH_SCOPE_SUB); if (!part->ops->ModifyDN) { return ldapsrv_unwilling(call, 53); @@ -187,7 +188,7 @@ static NTSTATUS ldapsrv_CompareRequest(struct ldapsrv_call *call) DEBUG(10, ("CompareRequest")); DEBUGADD(10, (" dn: %s", req->dn)); - part = ldapsrv_get_partition(call->conn, req->dn); + part = ldapsrv_get_partition(call->conn, req->dn, LDAP_SEARCH_SCOPE_SUB); if (!part->ops->Compare) { return ldapsrv_unwilling(call, 53); diff --git a/source4/ldap_server/ldap_rootdse.c b/source4/ldap_server/ldap_rootdse.c index 631b38d383..09f0740680 100644 --- a/source4/ldap_server/ldap_rootdse.c +++ b/source4/ldap_server/ldap_rootdse.c @@ -315,8 +315,7 @@ static NTSTATUS rootdse_Search(struct ldapsrv_partition *partition, struct ldaps const char **attrs = NULL; if (r->scope != LDAP_SEARCH_SCOPE_BASE) { - count = -1; - goto no_base_scope; + return NT_STATUS_INVALID_PARAMETER; } local_ctx = talloc_named(call, 0, "rootdse_Search local memory context"); |