summaryrefslogtreecommitdiff
path: root/source4/torture/ldap
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-11-06 20:15:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:05:35 -0500
commit8408b3428d8c263f8453a0da8ef71e7fc1e4ec81 (patch)
tree4c8b4a7686f730333fdf137c28166c7c561414b0 /source4/torture/ldap
parenteee5cc3b9a6fe7cdc1fa81fac8ce524391bee519 (diff)
downloadsamba-8408b3428d8c263f8453a0da8ef71e7fc1e4ec81.tar.gz
samba-8408b3428d8c263f8453a0da8ef71e7fc1e4ec81.tar.bz2
samba-8408b3428d8c263f8453a0da8ef71e7fc1e4ec81.zip
r3583: - seperate the ldap client code and the ldap parsing code
(vl: we should only sync the parsing code with trunk) - use hierachical talloc in the ldap client code metze (This used to be commit 1e9c0b68ca9ddb28877d45fc1b47653b13a7446d)
Diffstat (limited to 'source4/torture/ldap')
-rw-r--r--source4/torture/ldap/basic.c6
-rw-r--r--source4/torture/ldap/common.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/source4/torture/ldap/basic.c b/source4/torture/ldap/basic.c
index 4a0ae772d2..8b1aca05f4 100644
--- a/source4/torture/ldap/basic.c
+++ b/source4/torture/ldap/basic.c
@@ -82,7 +82,7 @@ static BOOL test_search_rootDSE(struct ldap_connection *conn, char **basedn)
conn->searchid = 0;
conn->next_msgid = 30;
- msg = new_ldap_message();
+ msg = new_ldap_message(conn);
if (!msg) {
return False;
}
@@ -147,7 +147,7 @@ static BOOL test_compare_sasl(struct ldap_connection *conn, const char *basedn)
conn->next_msgid = 55;
- msg = new_ldap_message();
+ msg = new_ldap_message(conn);
if (!msg) {
return False;
}
@@ -200,7 +200,7 @@ BOOL torture_ldap_basic(void)
url = talloc_asprintf(mem_ctx, "ldap://%s/", host);
- status = torture_ldap_connection(&conn, url, userdn, secret);
+ status = torture_ldap_connection(mem_ctx, &conn, url, userdn, secret);
if (!NT_STATUS_IS_OK(status)) {
return False;
}
diff --git a/source4/torture/ldap/common.c b/source4/torture/ldap/common.c
index a0fe31d0e9..eea3b12073 100644
--- a/source4/torture/ldap/common.c
+++ b/source4/torture/ldap/common.c
@@ -67,25 +67,25 @@ NTSTATUS torture_ldap_bind_sasl(struct ldap_connection *conn, const char *userna
}
/* open a ldap connection to a server */
-NTSTATUS torture_ldap_connection(struct ldap_connection **conn,
+NTSTATUS torture_ldap_connection(TALLOC_CTX *mem_ctx, struct ldap_connection **conn,
const char *url, const char *userdn, const char *password)
{
NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
- BOOL ret;
+ int ret;
if (!url) {
printf("You must specify a url string\n");
return NT_STATUS_INVALID_PARAMETER;
}
- *conn = new_ldap_connection();
+ *conn = ldap_connect(mem_ctx, url);
if (!*conn) {
printf("Failed to initialize ldap_connection structure\n");
return status;
}
- ret = ldap_setup_connection(*conn, url, userdn, password);
- if (!ret) {
+ ret = ldap_bind_simple(*conn, userdn, password);
+ if (ret != LDAP_SUCCESS) {
printf("Failed to connect with url [%s]\n", url);
/* FIXME: what abut actually implementing an ldap_connection_free() function ?
:-) sss */