summaryrefslogtreecommitdiff
path: root/source4/winbind
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-03 21:25:17 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:47 +0100
commitb83a7a135f3247f553cb04173646b2d871b97235 (patch)
tree4b2ea9eab1a603a6324e78bc98f91e9f3150a348 /source4/winbind
parent1f69adddc54d3b4b91df0ce639b3faccb85b2eb7 (diff)
downloadsamba-b83a7a135f3247f553cb04173646b2d871b97235.tar.gz
samba-b83a7a135f3247f553cb04173646b2d871b97235.tar.bz2
samba-b83a7a135f3247f553cb04173646b2d871b97235.zip
r26268: Avoid more use of global_loadparm - put lp_ctx in smb_server and wbsrv_connection.
(This used to be commit 7c008664238ed966cb82adf5b25b22157bb50730)
Diffstat (limited to 'source4/winbind')
-rw-r--r--source4/winbind/wb_cmd_getpwnam.c8
-rw-r--r--source4/winbind/wb_cmd_getpwuid.c6
-rw-r--r--source4/winbind/wb_dom_info.c3
-rw-r--r--source4/winbind/wb_dom_info_trusted.c2
-rw-r--r--source4/winbind/wb_init_domain.c10
-rw-r--r--source4/winbind/wb_name2domain.c2
-rw-r--r--source4/winbind/wb_pam_auth.c6
-rw-r--r--source4/winbind/wb_samba3_cmd.c10
-rw-r--r--source4/winbind/wb_server.c1
-rw-r--r--source4/winbind/wb_server.h2
-rw-r--r--source4/winbind/wb_sid2domain.c2
11 files changed, 30 insertions, 22 deletions
diff --git a/source4/winbind/wb_cmd_getpwnam.c b/source4/winbind/wb_cmd_getpwnam.c
index 5029e168a2..fb2dc197c9 100644
--- a/source4/winbind/wb_cmd_getpwnam.c
+++ b/source4/winbind/wb_cmd_getpwnam.c
@@ -86,7 +86,7 @@ static void cmd_getpwnam_recv_domain(struct composite_context *ctx)
user_info = talloc(state, struct libnet_UserInfo);
if (composite_nomem(user_info, state->ctx)) return;
- ok= wb_samba3_split_username(state, global_loadparm, state->name, &user_dom, &user_name);
+ ok= wb_samba3_split_username(state, state->service->task->lp_ctx, state->name, &user_dom, &user_name);
if(!ok){
composite_error(state->ctx, NT_STATUS_OBJECT_NAME_INVALID);
return;
@@ -124,12 +124,14 @@ static void cmd_getpwnam_recv_user_info(struct composite_context *ctx)
WBSRV_SAMBA3_SET_STRING(pw->pw_name, user_info->out.account_name);
WBSRV_SAMBA3_SET_STRING(pw->pw_passwd, "*");
WBSRV_SAMBA3_SET_STRING(pw->pw_gecos, user_info->out.full_name);
- WBSRV_SAMBA3_SET_STRING(pw->pw_dir, lp_template_homedir(global_loadparm));
+ WBSRV_SAMBA3_SET_STRING(pw->pw_dir,
+ lp_template_homedir(state->service->task->lp_ctx));
all_string_sub(pw->pw_dir, "%WORKGROUP%", state->workgroup_name,
sizeof(fstring) - 1);
all_string_sub(pw->pw_dir, "%ACCOUNTNAME%", user_info->out.account_name,
sizeof(fstring) - 1);
- WBSRV_SAMBA3_SET_STRING(pw->pw_shell, lp_template_shell(global_loadparm));
+ WBSRV_SAMBA3_SET_STRING(pw->pw_shell,
+ lp_template_shell(state->service->task->lp_ctx));
state->group_sid = dom_sid_dup(state, user_info->out.primary_group_sid);
if(composite_nomem(state->group_sid, state->ctx)) return;
diff --git a/source4/winbind/wb_cmd_getpwuid.c b/source4/winbind/wb_cmd_getpwuid.c
index 339f7e896c..c250af1b56 100644
--- a/source4/winbind/wb_cmd_getpwuid.c
+++ b/source4/winbind/wb_cmd_getpwuid.c
@@ -148,12 +148,14 @@ static void cmd_getpwuid_recv_user_info(struct composite_context *ctx)
WBSRV_SAMBA3_SET_STRING(pw->pw_name, user_info->out.account_name);
WBSRV_SAMBA3_SET_STRING(pw->pw_passwd, "*");
WBSRV_SAMBA3_SET_STRING(pw->pw_gecos, user_info->out.full_name);
- WBSRV_SAMBA3_SET_STRING(pw->pw_dir, lp_template_homedir(global_loadparm));
+ WBSRV_SAMBA3_SET_STRING(pw->pw_dir,
+ lp_template_homedir(state->service->task->lp_ctx));
all_string_sub(pw->pw_dir, "%WORKGROUP%", state->workgroup,
sizeof(fstring) - 1);
all_string_sub(pw->pw_dir, "%ACCOUNTNAME%", user_info->out.account_name,
sizeof(fstring) - 1);
- WBSRV_SAMBA3_SET_STRING(pw->pw_shell, lp_template_shell(global_loadparm));
+ WBSRV_SAMBA3_SET_STRING(pw->pw_shell,
+ lp_template_shell(state->service->task->lp_ctx));
pw->pw_uid = state->uid;
diff --git a/source4/winbind/wb_dom_info.c b/source4/winbind/wb_dom_info.c
index 13d446897e..99538bfb00 100644
--- a/source4/winbind/wb_dom_info.c
+++ b/source4/winbind/wb_dom_info.c
@@ -68,7 +68,8 @@ struct composite_context *wb_get_dom_info_send(TALLOC_CTX *mem_ctx,
if (dom_sid == NULL) goto failed;
ctx = finddcs_send(mem_ctx, domain_name, NBT_NAME_LOGON,
- dom_sid, lp_name_resolve_order(global_loadparm),
+ dom_sid,
+ lp_name_resolve_order(service->task->lp_ctx),
service->task->event_ctx,
service->task->msg_ctx);
if (ctx == NULL) goto failed;
diff --git a/source4/winbind/wb_dom_info_trusted.c b/source4/winbind/wb_dom_info_trusted.c
index 23436fa67a..5d960cb1d4 100644
--- a/source4/winbind/wb_dom_info_trusted.c
+++ b/source4/winbind/wb_dom_info_trusted.c
@@ -193,7 +193,7 @@ static void trusted_dom_info_recv_dcname(struct rpc_request *req)
make_nbt_name(&name, state->info->dcs[0].name, 0x20);
ctx = resolve_name_send(&name, state->service->task->event_ctx,
- lp_name_resolve_order(global_loadparm));
+ lp_name_resolve_order(state->service->task->lp_ctx));
composite_continue(state->ctx, ctx, trusted_dom_info_recv_dcaddr,
state);
diff --git a/source4/winbind/wb_init_domain.c b/source4/winbind/wb_init_domain.c
index 7d050d5c67..fbc2c0c80a 100644
--- a/source4/winbind/wb_init_domain.c
+++ b/source4/winbind/wb_init_domain.c
@@ -151,7 +151,7 @@ struct composite_context *wb_init_domain_send(TALLOC_CTX *mem_ctx,
cli_credentials_set_event_context(state->domain->libnet_ctx->cred, service->task->event_ctx);
- cli_credentials_set_conf(state->domain->libnet_ctx->cred, global_loadparm);
+ cli_credentials_set_conf(state->domain->libnet_ctx->cred, service->task->lp_ctx);
/* Connect the machine account to the credentials */
state->ctx->status =
@@ -163,14 +163,14 @@ struct composite_context *wb_init_domain_send(TALLOC_CTX *mem_ctx,
state->domain->netlogon_pipe = NULL;
if ((!cli_credentials_is_anonymous(state->domain->libnet_ctx->cred)) &&
- ((lp_server_role(global_loadparm) == ROLE_DOMAIN_MEMBER) ||
- (lp_server_role(global_loadparm) == ROLE_DOMAIN_CONTROLLER)) &&
+ ((lp_server_role(service->task->lp_ctx) == ROLE_DOMAIN_MEMBER) ||
+ (lp_server_role(service->task->lp_ctx) == ROLE_DOMAIN_CONTROLLER)) &&
(dom_sid_equal(state->domain->info->sid,
state->service->primary_sid))) {
state->domain->netlogon_binding->flags |= DCERPC_SCHANNEL;
/* For debugging, it can be a real pain if all the traffic is encrypted */
- if (lp_winbind_sealed_pipes(global_loadparm)) {
+ if (lp_winbind_sealed_pipes(service->task->lp_ctx)) {
state->domain->netlogon_binding->flags |= (DCERPC_SIGN | DCERPC_SEAL );
} else {
state->domain->netlogon_binding->flags |= (DCERPC_SIGN);
@@ -216,7 +216,7 @@ static void init_domain_recv_netlogonpipe(struct composite_context *ctx)
state->domain->lsa_binding = init_domain_binding(state, &ndr_table_lsarpc);
/* For debugging, it can be a real pain if all the traffic is encrypted */
- if (lp_winbind_sealed_pipes(global_loadparm)) {
+ if (lp_winbind_sealed_pipes(state->service->task->lp_ctx)) {
state->domain->lsa_binding->flags |= (DCERPC_SIGN | DCERPC_SEAL );
} else {
state->domain->lsa_binding->flags |= (DCERPC_SIGN);
diff --git a/source4/winbind/wb_name2domain.c b/source4/winbind/wb_name2domain.c
index 60fe18b5b9..e19703b1e5 100644
--- a/source4/winbind/wb_name2domain.c
+++ b/source4/winbind/wb_name2domain.c
@@ -55,7 +55,7 @@ struct composite_context *wb_name2domain_send(TALLOC_CTX *mem_ctx,
result->private_data = state;
state->service = service;
- ok = wb_samba3_split_username(state, global_loadparm, name, &user_dom, &user_name);
+ ok = wb_samba3_split_username(state, service->task->lp_ctx, name, &user_dom, &user_name);
if(!ok) {
composite_error(state->ctx, NT_STATUS_OBJECT_NAME_INVALID);
return result;
diff --git a/source4/winbind/wb_pam_auth.c b/source4/winbind/wb_pam_auth.c
index 06e2bff990..9045c63d63 100644
--- a/source4/winbind/wb_pam_auth.c
+++ b/source4/winbind/wb_pam_auth.c
@@ -221,11 +221,11 @@ struct composite_context *wb_cmd_pam_auth_send(TALLOC_CTX *mem_ctx,
DATA_BLOB chal, nt_resp, lm_resp, names_blob;
int flags = CLI_CRED_NTLM_AUTH;
- if (lp_client_lanman_auth(global_loadparm)) {
+ if (lp_client_lanman_auth(service->task->lp_ctx)) {
flags |= CLI_CRED_LANMAN_AUTH;
}
- if (lp_client_ntlmv2_auth(global_loadparm)) {
+ if (lp_client_ntlmv2_auth(service->task->lp_ctx)) {
flags |= CLI_CRED_NTLMv2_AUTH;
}
@@ -235,7 +235,7 @@ struct composite_context *wb_cmd_pam_auth_send(TALLOC_CTX *mem_ctx,
if (!credentials) {
return NULL;
}
- cli_credentials_set_conf(credentials, global_loadparm);
+ cli_credentials_set_conf(credentials, service->task->lp_ctx);
cli_credentials_set_domain(credentials, domain, CRED_SPECIFIED);
cli_credentials_set_username(credentials, user, CRED_SPECIFIED);
diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c
index 041284e307..24074700fc 100644
--- a/source4/winbind/wb_samba3_cmd.c
+++ b/source4/winbind/wb_samba3_cmd.c
@@ -86,7 +86,7 @@ NTSTATUS wbsrv_samba3_interface_version(struct wbsrv_samba3_call *s3call)
NTSTATUS wbsrv_samba3_info(struct wbsrv_samba3_call *s3call)
{
s3call->response.result = WINBINDD_OK;
- s3call->response.data.info.winbind_separator = *lp_winbind_separator(global_loadparm);
+ s3call->response.data.info.winbind_separator = *lp_winbind_separator(s3call->wbconn->lp_ctx);
WBSRV_SAMBA3_SET_STRING(s3call->response.data.info.samba_version,
SAMBA_VERSION_STRING);
return NT_STATUS_OK;
@@ -96,7 +96,7 @@ NTSTATUS wbsrv_samba3_domain_name(struct wbsrv_samba3_call *s3call)
{
s3call->response.result = WINBINDD_OK;
WBSRV_SAMBA3_SET_STRING(s3call->response.data.domain_name,
- lp_workgroup(global_loadparm));
+ lp_workgroup(s3call->wbconn->lp_ctx));
return NT_STATUS_OK;
}
@@ -104,7 +104,7 @@ NTSTATUS wbsrv_samba3_netbios_name(struct wbsrv_samba3_call *s3call)
{
s3call->response.result = WINBINDD_OK;
WBSRV_SAMBA3_SET_STRING(s3call->response.data.netbios_name,
- lp_netbios_name(global_loadparm));
+ lp_netbios_name(s3call->wbconn->lp_ctx));
return NT_STATUS_OK;
}
@@ -112,7 +112,7 @@ NTSTATUS wbsrv_samba3_priv_pipe_dir(struct wbsrv_samba3_call *s3call)
{
s3call->response.result = WINBINDD_OK;
s3call->response.extra_data.data =
- smbd_tmp_path(s3call, global_loadparm, WINBINDD_SAMBA3_PRIVILEGED_SOCKET);
+ smbd_tmp_path(s3call, s3call->wbconn->lp_ctx, WINBINDD_SAMBA3_PRIVILEGED_SOCKET);
NT_STATUS_HAVE_NO_MEMORY(s3call->response.extra_data.data);
return NT_STATUS_OK;
}
@@ -545,7 +545,7 @@ NTSTATUS wbsrv_samba3_pam_auth(struct wbsrv_samba3_call *s3call)
s3call->wbconn->listen_socket->service;
char *user, *domain;
- if (!wb_samba3_split_username(s3call, global_loadparm,
+ if (!wb_samba3_split_username(s3call, s3call->wbconn->lp_ctx,
s3call->request.data.auth.user,
&domain, &user)) {
return NT_STATUS_NO_SUCH_USER;
diff --git a/source4/winbind/wb_server.c b/source4/winbind/wb_server.c
index 0b3ebc461f..87ffc5b98e 100644
--- a/source4/winbind/wb_server.c
+++ b/source4/winbind/wb_server.c
@@ -60,6 +60,7 @@ static void wbsrv_accept(struct stream_connection *conn)
}
wbconn->conn = conn;
wbconn->listen_socket = listen_socket;
+ wbconn->lp_ctx = global_loadparm;
conn->private = wbconn;
wbconn->packet = packet_init(wbconn);
diff --git a/source4/winbind/wb_server.h b/source4/winbind/wb_server.h
index 369fe025a9..f3cfc18565 100644
--- a/source4/winbind/wb_server.h
+++ b/source4/winbind/wb_server.h
@@ -99,6 +99,8 @@ struct wbsrv_connection {
uint32_t pending_calls;
struct packet_context *packet;
+
+ struct loadparm_context *lp_ctx;
};
#define WBSRV_SAMBA3_SET_STRING(dest, src) do { \
diff --git a/source4/winbind/wb_sid2domain.c b/source4/winbind/wb_sid2domain.c
index 8336449602..fcf02cedcd 100644
--- a/source4/winbind/wb_sid2domain.c
+++ b/source4/winbind/wb_sid2domain.c
@@ -85,7 +85,7 @@ struct composite_context *wb_sid2domain_send(TALLOC_CTX *mem_ctx,
if (dom_sid_equal(service->primary_sid, sid) ||
dom_sid_in_domain(service->primary_sid, sid)) {
- ctx = wb_get_dom_info_send(state, service, lp_workgroup(global_loadparm),
+ ctx = wb_get_dom_info_send(state, service, lp_workgroup(service->task->lp_ctx),
service->primary_sid);
if (ctx == NULL) goto failed;
ctx->async.fn = sid2domain_recv_dom_info;