summaryrefslogtreecommitdiff
path: root/source4/ldap_server
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-02 17:09:52 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:04 +0100
commitf4a1083cf9f64b4d2b65b68942e93861409ea90f (patch)
treef5e03ad4edfa14eaf09d9d781825a6a30b67b5a9 /source4/ldap_server
parent2fa338cdc99276a5f85ad54cb88b372ffe8ab063 (diff)
downloadsamba-f4a1083cf9f64b4d2b65b68942e93861409ea90f.tar.gz
samba-f4a1083cf9f64b4d2b65b68942e93861409ea90f.tar.bz2
samba-f4a1083cf9f64b4d2b65b68942e93861409ea90f.zip
r26227: Make loadparm_context part of a server task, move loadparm_contexts further up the call stack.
(This used to be commit 0721a07aada6a1fae6dcbd610b8783df57d7bbad)
Diffstat (limited to 'source4/ldap_server')
-rw-r--r--source4/ldap_server/ldap_server.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c
index c165eb698a..1ee37dceff 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -441,6 +441,7 @@ static const struct stream_server_ops ldap_stream_ops = {
add a socket address to the list of events, one event per port
*/
static NTSTATUS add_socket(struct event_context *event_context,
+ struct loadparm_context *lp_ctx,
const struct model_ops *model_ops,
const char *address, struct ldapsrv_service *ldap_service)
{
@@ -471,7 +472,7 @@ static NTSTATUS add_socket(struct event_context *event_context,
}
/* Load LDAP database */
- ldb = samdb_connect(ldap_service, system_session(ldap_service));
+ ldb = samdb_connect(ldap_service, lp_ctx, system_session(ldap_service));
if (!ldb) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
}
@@ -538,7 +539,7 @@ static void ldapsrv_task_init(struct task_server *task)
ldap_service->tls_params = tls_initialise(ldap_service);
if (ldap_service->tls_params == NULL) goto failed;
- if (lp_interfaces(global_loadparm) && lp_bind_interfaces_only(global_loadparm)) {
+ if (lp_interfaces(task->lp_ctx) && lp_bind_interfaces_only(task->lp_ctx)) {
int num_interfaces = iface_count();
int i;
@@ -548,16 +549,16 @@ static void ldapsrv_task_init(struct task_server *task)
*/
for(i = 0; i < num_interfaces; i++) {
const char *address = iface_n_ip(i);
- status = add_socket(task->event_ctx, model_ops, address, ldap_service);
+ status = add_socket(task->event_ctx, task->lp_ctx, model_ops, address, ldap_service);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
} else {
- status = add_socket(task->event_ctx, model_ops,
- lp_socket_address(global_loadparm), ldap_service);
+ status = add_socket(task->event_ctx, task->lp_ctx, model_ops,
+ lp_socket_address(task->lp_ctx), ldap_service);
if (!NT_STATUS_IS_OK(status)) goto failed;
}
- ldapi_path = private_path(ldap_service, global_loadparm, "ldapi");
+ ldapi_path = private_path(ldap_service, task->lp_ctx, "ldapi");
if (!ldapi_path) {
goto failed;
}