mirror of
https://github.com/samba-team/samba.git
synced 2025-11-07 12:23:51 +03:00
r2891: call rootDSE only with LDAP_SEARCH_SCOPE_BASE
this is needed because of the global catalog metze
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
82e792a0ce
commit
071c19c25d
@@ -45,9 +45,10 @@ NTSTATUS ldapsrv_queue_reply(struct ldapsrv_call *call, struct ldapsrv_reply *re
|
|||||||
return NT_STATUS_OK;
|
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;
|
return conn->service->rootDSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,7 +88,7 @@ static NTSTATUS ldapsrv_SearchRequest(struct ldapsrv_call *call)
|
|||||||
DEBUGADD(10, (" basedn: %s", req->basedn));
|
DEBUGADD(10, (" basedn: %s", req->basedn));
|
||||||
DEBUGADD(10, (" filter: %s\n", req->filter));
|
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) {
|
if (!part->ops->Search) {
|
||||||
struct ldap_Result *done;
|
struct ldap_Result *done;
|
||||||
@@ -118,7 +119,7 @@ static NTSTATUS ldapsrv_ModifyRequest(struct ldapsrv_call *call)
|
|||||||
DEBUG(10, ("ModifyRequest"));
|
DEBUG(10, ("ModifyRequest"));
|
||||||
DEBUGADD(10, (" dn: %s", req->dn));
|
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) {
|
if (!part->ops->Modify) {
|
||||||
return ldapsrv_unwilling(call, 53);
|
return ldapsrv_unwilling(call, 53);
|
||||||
@@ -135,7 +136,7 @@ static NTSTATUS ldapsrv_AddRequest(struct ldapsrv_call *call)
|
|||||||
DEBUG(10, ("AddRequest"));
|
DEBUG(10, ("AddRequest"));
|
||||||
DEBUGADD(10, (" dn: %s", req->dn));
|
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) {
|
if (!part->ops->Add) {
|
||||||
return ldapsrv_unwilling(call, 53);
|
return ldapsrv_unwilling(call, 53);
|
||||||
@@ -152,7 +153,7 @@ static NTSTATUS ldapsrv_DelRequest(struct ldapsrv_call *call)
|
|||||||
DEBUG(10, ("DelRequest"));
|
DEBUG(10, ("DelRequest"));
|
||||||
DEBUGADD(10, (" dn: %s", req->dn));
|
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) {
|
if (!part->ops->Del) {
|
||||||
return ldapsrv_unwilling(call, 53);
|
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, (" dn: %s", req->dn));
|
||||||
DEBUGADD(10, (" newrdn: %s", req->newrdn));
|
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) {
|
if (!part->ops->ModifyDN) {
|
||||||
return ldapsrv_unwilling(call, 53);
|
return ldapsrv_unwilling(call, 53);
|
||||||
@@ -187,7 +188,7 @@ static NTSTATUS ldapsrv_CompareRequest(struct ldapsrv_call *call)
|
|||||||
DEBUG(10, ("CompareRequest"));
|
DEBUG(10, ("CompareRequest"));
|
||||||
DEBUGADD(10, (" dn: %s", req->dn));
|
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) {
|
if (!part->ops->Compare) {
|
||||||
return ldapsrv_unwilling(call, 53);
|
return ldapsrv_unwilling(call, 53);
|
||||||
|
|||||||
@@ -315,8 +315,7 @@ static NTSTATUS rootdse_Search(struct ldapsrv_partition *partition, struct ldaps
|
|||||||
const char **attrs = NULL;
|
const char **attrs = NULL;
|
||||||
|
|
||||||
if (r->scope != LDAP_SEARCH_SCOPE_BASE) {
|
if (r->scope != LDAP_SEARCH_SCOPE_BASE) {
|
||||||
count = -1;
|
return NT_STATUS_INVALID_PARAMETER;
|
||||||
goto no_base_scope;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
local_ctx = talloc_named(call, 0, "rootdse_Search local memory context");
|
local_ctx = talloc_named(call, 0, "rootdse_Search local memory context");
|
||||||
|
|||||||
Reference in New Issue
Block a user