summaryrefslogtreecommitdiff
path: root/source4/ldap_server
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-03 21:25:06 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:42 +0100
commit2f8dc4f48f1802baa3405e7803563f6840e0d1b3 (patch)
treea479c7df067cb698134616bc6be8fa2fd76c7452 /source4/ldap_server
parentc9f0011bc57e6536f4ec130784d15609e71aa694 (diff)
downloadsamba-2f8dc4f48f1802baa3405e7803563f6840e0d1b3.tar.gz
samba-2f8dc4f48f1802baa3405e7803563f6840e0d1b3.tar.bz2
samba-2f8dc4f48f1802baa3405e7803563f6840e0d1b3.zip
r26266: Remove more global_loadparm uses.
(This used to be commit 99113075c4a96679bcec4f4d6bba4acb3dee4245)
Diffstat (limited to 'source4/ldap_server')
-rw-r--r--source4/ldap_server/ldap_backend.c5
-rw-r--r--source4/ldap_server/ldap_bind.c6
-rw-r--r--source4/ldap_server/ldap_server.c5
-rw-r--r--source4/ldap_server/ldap_server.h1
4 files changed, 10 insertions, 7 deletions
diff --git a/source4/ldap_server/ldap_backend.c b/source4/ldap_server/ldap_backend.c
index a6697dfba8..346aacaa99 100644
--- a/source4/ldap_server/ldap_backend.c
+++ b/source4/ldap_server/ldap_backend.c
@@ -56,8 +56,9 @@ static int map_ldb_error(struct ldb_context *ldb, int err, const char **errstrin
NTSTATUS ldapsrv_backend_Init(struct ldapsrv_connection *conn)
{
conn->ldb = ldb_wrap_connect(conn,
- global_loadparm,
- lp_sam_url(global_loadparm), conn->session_info,
+ conn->lp_ctx,
+ lp_sam_url(conn->lp_ctx),
+ conn->session_info,
NULL, conn->global_catalog ? LDB_FLG_RDONLY : 0, NULL);
if (conn->ldb == NULL) {
return NT_STATUS_INTERNAL_DB_CORRUPTION;
diff --git a/source4/ldap_server/ldap_bind.c b/source4/ldap_server/ldap_bind.c
index 874c9bfb49..53cef5b349 100644
--- a/source4/ldap_server/ldap_bind.c
+++ b/source4/ldap_server/ldap_bind.c
@@ -45,12 +45,12 @@ static NTSTATUS ldapsrv_BindSimple(struct ldapsrv_call *call)
DEBUG(10, ("BindSimple dn: %s\n",req->dn));
- status = crack_auto_name_to_nt4_name(call, global_loadparm, req->dn, &nt4_domain, &nt4_account);
+ status = crack_auto_name_to_nt4_name(call, call->conn->lp_ctx, req->dn, &nt4_domain, &nt4_account);
if (NT_STATUS_IS_OK(status)) {
status = authenticate_username_pw(call,
call->conn->connection->event.ctx,
call->conn->connection->msg_ctx,
- global_loadparm,
+ call->conn->lp_ctx,
nt4_domain, nt4_account,
req->creds.password,
&session_info);
@@ -143,7 +143,7 @@ static NTSTATUS ldapsrv_BindSASL(struct ldapsrv_call *call)
status = gensec_server_start(conn,
conn->connection->event.ctx,
- global_loadparm,
+ conn->lp_ctx,
conn->connection->msg_ctx,
&conn->gensec);
if (!NT_STATUS_IS_OK(status)) {
diff --git a/source4/ldap_server/ldap_server.c b/source4/ldap_server/ldap_server.c
index 9d6de732cf..2898d131c9 100644
--- a/source4/ldap_server/ldap_server.c
+++ b/source4/ldap_server/ldap_server.c
@@ -345,6 +345,7 @@ static void ldapsrv_accept(struct stream_connection *c)
conn->connection = c;
conn->service = ldapsrv_service;
conn->sockets.raw = c->socket;
+ conn->lp_ctx = global_loadparm;
c->private = conn;
@@ -395,7 +396,7 @@ static void ldapsrv_accept(struct stream_connection *c)
return;
}
- cli_credentials_set_conf(server_credentials, global_loadparm);
+ cli_credentials_set_conf(server_credentials, conn->lp_ctx);
status = cli_credentials_set_machine_account(server_credentials);
if (!NT_STATUS_IS_OK(status)) {
stream_terminate_connection(c, talloc_asprintf(conn, "Failed to obtain server credentials, perhaps a standalone server?: %s\n", nt_errstr(status)));
@@ -404,7 +405,7 @@ static void ldapsrv_accept(struct stream_connection *c)
conn->server_credentials = server_credentials;
/* Connections start out anonymous */
- if (!NT_STATUS_IS_OK(auth_anonymous_session_info(conn, global_loadparm, &conn->session_info))) {
+ if (!NT_STATUS_IS_OK(auth_anonymous_session_info(conn, conn->lp_ctx, &conn->session_info))) {
ldapsrv_terminate_connection(conn, "failed to setup anonymous session info");
return;
}
diff --git a/source4/ldap_server/ldap_server.h b/source4/ldap_server/ldap_server.h
index df0bb92175..88af0fb5fc 100644
--- a/source4/ldap_server/ldap_server.h
+++ b/source4/ldap_server/ldap_server.h
@@ -23,6 +23,7 @@
#include "lib/stream/packet.h"
struct ldapsrv_connection {
+ struct loadparm_context *lp_ctx;
struct stream_connection *connection;
struct gensec_security *gensec;
struct auth_session_info *session_info;