summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorKamen Mazdrashki <kamen.mazdrashki@postpath.com>2010-01-25 12:22:39 +0200
committerStefan Metzmacher <metze@samba.org>2010-01-29 14:09:53 +0100
commita4d0ed5a1027f4cb58732c78cb63464dbf9cc287 (patch)
treeef058178e5b12210710c2cdcbb94e02c8a9a84c2 /source4/lib/ldb
parente3d50e89ab5081ae858017f83f3258283baaf978 (diff)
downloadsamba-a4d0ed5a1027f4cb58732c78cb63464dbf9cc287.tar.gz
samba-a4d0ed5a1027f4cb58732c78cb63464dbf9cc287.tar.bz2
samba-a4d0ed5a1027f4cb58732c78cb63464dbf9cc287.zip
s4/ldap: Fix nested searches SEGFAULT bug
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/ldb_ildap/ldb_ildap.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
index 53257a1ab0..6eb2e1719c 100644
--- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -278,6 +278,13 @@ static void ildb_callback(struct ldap_request *req)
break;
case LDAP_TAG_SearchRequest:
+ /* check if we are already processing this request */
+ if (req->in_dispatch_replies) {
+ return;
+ }
+
+ req->in_dispatch_replies = true;
+
/* loop over all messages */
for (i = 0; i < req->num_replies; i++) {
@@ -327,6 +334,7 @@ static void ildb_callback(struct ldap_request *req)
if (ret != LDB_SUCCESS) {
callback_failed = true;
}
+
break;
case LDAP_TAG_SearchResultReference:
@@ -337,6 +345,7 @@ static void ildb_callback(struct ldap_request *req)
if (ret != LDB_SUCCESS) {
callback_failed = true;
}
+
break;
default:
@@ -350,6 +359,8 @@ static void ildb_callback(struct ldap_request *req)
}
}
+ req->in_dispatch_replies = false;
+
talloc_free(req->replies);
req->replies = NULL;
req->num_replies = 0;