summaryrefslogtreecommitdiffstats
path: root/source4/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-02-13 11:38:21 +0100
committerStefan Metzmacher <metze@samba.org>2009-02-13 13:44:37 +0100
commitf3c5bd9b776def71517a6395c595f3bd941434eb (patch)
tree7c202ff6d4d2554a61bd8d89df7a7c8b0bdca184 /source4/lib
parent3c9ad421fb03c70f49ec60666fce592e122d5616 (diff)
downloadsamba-f3c5bd9b776def71517a6395c595f3bd941434eb.tar.gz
samba-f3c5bd9b776def71517a6395c595f3bd941434eb.tar.xz
samba-f3c5bd9b776def71517a6395c595f3bd941434eb.zip
s4:ldb_ildap: remove compiler warnings
metze
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/ldb_ildap/ldb_ildap.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source4/lib/ldb/ldb_ildap/ldb_ildap.c b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
index 3901b9b4361..b1344050489 100644
--- a/source4/lib/ldb/ldb_ildap/ldb_ildap.c
+++ b/source4/lib/ldb/ldb_ildap/ldb_ildap.c
@@ -168,14 +168,16 @@ static int ildb_map_error(struct ldb_module *module, NTSTATUS status)
{
struct ildb_private *ildb;
struct ldb_context *ldb;
+ TALLOC_CTX *mem_ctx;
ildb = talloc_get_type(ldb_module_get_private(module), struct ildb_private);
ldb = ldb_module_get_ctx(module);
- TALLOC_CTX *mem_ctx = talloc_new(ildb);
if (NT_STATUS_IS_OK(status)) {
return LDB_SUCCESS;
}
+
+ mem_ctx = talloc_new(ildb);
if (!mem_ctx) {
ldb_oom(ldb);
return LDB_ERR_OPERATIONS_ERROR;
@@ -467,7 +469,7 @@ static int ildb_search(struct ildb_context *ac)
for (n = 0; req->op.search.attrs && req->op.search.attrs[n]; n++) /* noop */ ;
msg->r.SearchRequest.num_attributes = n;
- msg->r.SearchRequest.attributes = discard_const(req->op.search.attrs);
+ msg->r.SearchRequest.attributes = req->op.search.attrs;
msg->controls = req->controls;
return ildb_request_send(ac, msg);
@@ -759,6 +761,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
struct ildb_private *ildb;
NTSTATUS status;
struct cli_credentials *creds;
+ struct loadparm_context *lp_ctx;
module = ldb_module_new(ldb, ldb, "ldb_ildap backend", &ildb_ops);
if (!module) return -1;
@@ -772,8 +775,10 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
ildb->event_ctx = ldb_get_event_context(ldb);
+ lp_ctx = talloc_get_type(ldb_get_opaque(ldb, "loadparm"),
+ struct loadparm_context);
- ildb->ldap = ldap4_new_connection(ildb, ldb_get_opaque(ldb, "loadparm"),
+ ildb->ldap = ldap4_new_connection(ildb, lp_ctx,
ildb->event_ctx);
if (!ildb->ldap) {
ldb_oom(ldb);
@@ -811,7 +816,7 @@ static int ildb_connect(struct ldb_context *ldb, const char *url,
goto failed;
}
} else {
- status = ldap_bind_sasl(ildb->ldap, creds, ldb_get_opaque(ldb, "loadparm"));
+ status = ldap_bind_sasl(ildb->ldap, creds, lp_ctx);
if (!NT_STATUS_IS_OK(status)) {
ldb_debug(ldb, LDB_DEBUG_ERROR, "Failed to bind - %s\n",
ldap_errstr(ildb->ldap, module, status));