summaryrefslogtreecommitdiffstats
path: root/source4/torture/ldap
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-10-23 14:27:00 +1100
committerAndrew Tridgell <tridge@samba.org>2009-10-23 14:52:17 +1100
commit4ad0397d8afdd6bec609506f3736f8567afe7564 (patch)
treec46f3b0f8d5b602ca1cb3b0c32b005d181acdbdc /source4/torture/ldap
parent05f93c3e8fe2b0f6e520686742c48c78c96605ab (diff)
downloadsamba-4ad0397d8afdd6bec609506f3736f8567afe7564.tar.gz
samba-4ad0397d8afdd6bec609506f3736f8567afe7564.tar.xz
samba-4ad0397d8afdd6bec609506f3736f8567afe7564.zip
s4-ldbwrap: added re-use of ldb contexts in ldb_wrap_connect()
This allows us to reuse a ldb context if it is open twice, instead of going through the expensive process of a full ldb open. We can reuse it if all of the parameters are the same. The change relies on callers using talloc_unlink() or free of a parent to close a ldb context.
Diffstat (limited to 'source4/torture/ldap')
-rw-r--r--source4/torture/ldap/ldap_sort.c2
-rw-r--r--source4/torture/ldap/schema.c2
-rw-r--r--source4/torture/ldap/uptodatevector.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/source4/torture/ldap/ldap_sort.c b/source4/torture/ldap/ldap_sort.c
index 4d732cf997..03fcfd8482 100644
--- a/source4/torture/ldap/ldap_sort.c
+++ b/source4/torture/ldap/ldap_sort.c
@@ -62,7 +62,7 @@ bool torture_ldap_sort(struct torture_context *torture)
ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, url,
NULL,
cmdline_credentials,
- 0, NULL);
+ 0);
torture_assert(torture, ldb, "Failed to make LDB connection to target");
ctx = talloc_zero(ldb, struct ldb_result);
diff --git a/source4/torture/ldap/schema.c b/source4/torture/ldap/schema.c
index e746a32f2b..7fe171691a 100644
--- a/source4/torture/ldap/schema.c
+++ b/source4/torture/ldap/schema.c
@@ -387,7 +387,7 @@ bool torture_ldap_schema(struct torture_context *torture)
ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, url,
NULL,
cmdline_credentials,
- 0, NULL);
+ 0);
if (!ldb) goto failed;
ret &= test_search_rootDSE(ldb, &rootDSE);
diff --git a/source4/torture/ldap/uptodatevector.c b/source4/torture/ldap/uptodatevector.c
index c53459a58e..a4ca7e5357 100644
--- a/source4/torture/ldap/uptodatevector.c
+++ b/source4/torture/ldap/uptodatevector.c
@@ -159,7 +159,7 @@ bool torture_ldap_uptodatevector(struct torture_context *torture)
ldb = ldb_wrap_connect(torture, torture->ev, torture->lp_ctx, url,
NULL,
cmdline_credentials,
- 0, NULL);
+ 0);
if (!ldb) goto failed;
ret &= test_check_uptodatevector(torture, ldb, samdb_base_dn(ldb));