Author: jelmer Date: 2007-12-13 23:23:25 +0000 (Thu, 13 Dec 2007) New Revision: 26441
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=26441 Log: Remove global_loadparm uses. Modified: branches/SAMBA_4_0/ branches/SAMBA_4_0/source/lib/messaging/irpc.h branches/SAMBA_4_0/source/lib/messaging/messaging.c branches/SAMBA_4_0/source/lib/messaging/tests/irpc.c branches/SAMBA_4_0/source/lib/messaging/tests/messaging.c branches/SAMBA_4_0/source/libnet/libnet_lookup.c branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rpc.c branches/SAMBA_4_0/source/smbd/service_stream.c branches/SAMBA_4_0/source/smbd/service_task.c branches/SAMBA_4_0/source/utils/getntacl.c branches/SAMBA_4_0/source/utils/ntlm_auth.c Changeset: Property changes on: branches/SAMBA_4_0 ___________________________________________________________________ Name: bzr:revision-info ...skipped... Name: bzr:revision-id:v3-trunk0 ...skipped... Modified: branches/SAMBA_4_0/source/lib/messaging/irpc.h =================================================================== --- branches/SAMBA_4_0/source/lib/messaging/irpc.h 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/lib/messaging/irpc.h 2007-12-13 23:23:25 UTC (rev 26441) @@ -92,9 +92,11 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, const char *dir, struct server_id server_id, + struct smb_iconv_convenience *iconv_convenience, struct event_context *ev); struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, const char *dir, + struct smb_iconv_convenience *iconv_convenience, struct event_context *ev); NTSTATUS messaging_send_ptr(struct messaging_context *msg, struct server_id server, uint32_t msg_type, void *ptr); Modified: branches/SAMBA_4_0/source/lib/messaging/messaging.c =================================================================== --- branches/SAMBA_4_0/source/lib/messaging/messaging.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/lib/messaging/messaging.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -49,6 +49,7 @@ struct idr_context *dispatch_tree; struct messaging_rec *pending; struct messaging_rec *retry_queue; + struct smb_iconv_convenience *iconv_convenience; struct irpc_list *irpc; struct idr_context *idr; const char **names; @@ -532,6 +533,7 @@ struct messaging_context *messaging_init(TALLOC_CTX *mem_ctx, const char *dir, struct server_id server_id, + struct smb_iconv_convenience *iconv_convenience, struct event_context *ev) { struct messaging_context *msg; @@ -560,6 +562,7 @@ msg->base_path = talloc_reference(msg, dir); msg->path = messaging_path(msg, server_id); msg->server_id = server_id; + msg->iconv_convenience = iconv_convenience; msg->idr = idr_init(msg); msg->dispatch_tree = idr_init(msg); msg->start_time = timeval_current(); @@ -609,12 +612,13 @@ */ struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx, const char *dir, + struct smb_iconv_convenience *iconv_convenience, struct event_context *ev) { struct server_id id; ZERO_STRUCT(id); id.id = random() % 0x10000000; - return messaging_init(mem_ctx, dir, id, ev); + return messaging_init(mem_ctx, dir, id, iconv_convenience, ev); } /* a list of registered irpc server functions @@ -698,7 +702,7 @@ m->header.status = status; /* setup the reply */ - push = ndr_push_init_ctx(m->ndr, lp_iconv_convenience(global_loadparm)); + push = ndr_push_init_ctx(m->ndr, m->msg_ctx->iconv_convenience); if (push == NULL) { status = NT_STATUS_NO_MEMORY; goto failed; @@ -798,7 +802,7 @@ m->from = src; - m->ndr = ndr_pull_init_blob(packet, m, lp_iconv_convenience(global_loadparm)); + m->ndr = ndr_pull_init_blob(packet, m, msg_ctx->iconv_convenience); if (m->ndr == NULL) goto failed; m->ndr->flags |= LIBNDR_FLAG_REF_ALLOC; @@ -890,7 +894,7 @@ header.status = NT_STATUS_OK; /* construct the irpc packet */ - ndr = ndr_push_init_ctx(irpc, lp_iconv_convenience(global_loadparm)); + ndr = ndr_push_init_ctx(irpc, msg_ctx->iconv_convenience); if (ndr == NULL) goto failed; ndr_err = ndr_push_irpc_header(ndr, NDR_SCALARS|NDR_BUFFERS, &header); Modified: branches/SAMBA_4_0/source/lib/messaging/tests/irpc.c =================================================================== --- branches/SAMBA_4_0/source/lib/messaging/tests/irpc.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/lib/messaging/tests/irpc.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -221,13 +221,17 @@ torture_assert(tctx, data->msg_ctx1 = messaging_init(tctx, lp_messaging_path(tctx, tctx->lp_ctx), - cluster_id(MSG_ID1), data->ev), + cluster_id(MSG_ID1), + lp_iconv_convenience(tctx->lp_ctx), + data->ev), "Failed to init first messaging context"); torture_assert(tctx, data->msg_ctx2 = messaging_init(tctx, lp_messaging_path(tctx, tctx->lp_ctx), - cluster_id(MSG_ID2), data->ev), + cluster_id(MSG_ID2), + lp_iconv_convenience(tctx->lp_ctx), + data->ev), "Failed to init second messaging context"); /* register the server side function */ Modified: branches/SAMBA_4_0/source/lib/messaging/tests/messaging.c =================================================================== --- branches/SAMBA_4_0/source/lib/messaging/tests/messaging.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/lib/messaging/tests/messaging.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -73,7 +73,9 @@ msg_server_ctx = messaging_init(tctx, lp_messaging_path(tctx, tctx->lp_ctx), - cluster_id(1), ev); + cluster_id(1), + lp_iconv_convenience(tctx->lp_ctx), + ev); torture_assert(tctx, msg_server_ctx != NULL, "Failed to init ping messaging context"); @@ -82,7 +84,9 @@ msg_client_ctx = messaging_init(tctx, lp_messaging_path(tctx, tctx->lp_ctx), - cluster_id(2), ev); + cluster_id(2), + lp_iconv_convenience(tctx->lp_ctx), + ev); torture_assert(tctx, msg_client_ctx != NULL, "msg_client_ctx messaging_init() failed"); Modified: branches/SAMBA_4_0/source/libnet/libnet_lookup.c =================================================================== --- branches/SAMBA_4_0/source/libnet/libnet_lookup.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/libnet/libnet_lookup.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -192,7 +192,8 @@ { struct composite_context *c; struct messaging_context *msg_ctx = - messaging_client_init(mem_ctx, lp_messaging_path(mem_ctx, ctx->lp_ctx), ctx->event_ctx); + messaging_client_init(mem_ctx, lp_messaging_path(mem_ctx, ctx->lp_ctx), + lp_iconv_convenience(ctx->lp_ctx), ctx->event_ctx); c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx), lp_nbt_port(ctx->lp_ctx), io->in.domain_name, io->in.name_type, Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c =================================================================== --- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_auth.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -56,7 +56,8 @@ } else { /* Hope we can find the event context somewhere up there... */ ev = event_context_find(tmp_ctx); - msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, global_loadparm), ev); + msg = messaging_client_init(tmp_ctx, lp_messaging_path(tmp_ctx, global_loadparm), + lp_iconv_convenience(global_loadparm), ev); } if (auth_types) { Modified: branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rpc.c =================================================================== --- branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rpc.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/scripting/ejs/smbcalls_rpc.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -80,7 +80,9 @@ for (i=0;i<10000;i++) { p->msg_ctx = messaging_init(p, lp_messaging_path(p, global_loadparm), - cluster_id(EJS_ID_BASE + i), ev); + cluster_id(EJS_ID_BASE + i), + lp_iconv_convenience(global_loadparm), + ev); if (p->msg_ctx) break; } if (p->msg_ctx == NULL) { Modified: branches/SAMBA_4_0/source/smbd/service_stream.c =================================================================== --- branches/SAMBA_4_0/source/smbd/service_stream.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/smbd/service_stream.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -183,7 +183,9 @@ /* setup to receive internal messages on this connection */ srv_conn->msg_ctx = messaging_init(srv_conn, lp_messaging_path(srv_conn, global_loadparm), - srv_conn->server_id, ev); + srv_conn->server_id, + lp_iconv_convenience(global_loadparm), + ev); if (!srv_conn->msg_ctx) { stream_terminate_connection(srv_conn, "messaging_init() failed"); return; Modified: branches/SAMBA_4_0/source/smbd/service_task.c =================================================================== --- branches/SAMBA_4_0/source/smbd/service_task.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/smbd/service_task.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -68,7 +68,9 @@ task->msg_ctx = messaging_init(task, lp_messaging_path(task, task->lp_ctx), - task->server_id, task->event_ctx); + task->server_id, + lp_iconv_convenience(task->lp_ctx), + task->event_ctx); if (!task->msg_ctx) { task_server_terminate(task, "messaging_init() failed"); return; Modified: branches/SAMBA_4_0/source/utils/getntacl.c =================================================================== --- branches/SAMBA_4_0/source/utils/getntacl.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/utils/getntacl.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -72,7 +72,7 @@ } blob.length = size; - ndr = ndr_pull_init_blob(&blob, NULL, lp_iconv_convenience(global_loadparm)); + ndr = ndr_pull_init_blob(&blob, NULL, NULL); ndr_err = ndr_pull_xattr_NTACL(ndr, NDR_SCALARS|NDR_BUFFERS, *ntacl); if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) { Modified: branches/SAMBA_4_0/source/utils/ntlm_auth.c =================================================================== --- branches/SAMBA_4_0/source/utils/ntlm_auth.c 2007-12-13 22:46:55 UTC (rev 26440) +++ branches/SAMBA_4_0/source/utils/ntlm_auth.c 2007-12-13 23:23:25 UTC (rev 26441) @@ -471,7 +471,8 @@ if (!ev) { exit(1); } - msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx), ev); + msg = messaging_client_init(state, lp_messaging_path(state, lp_ctx), + lp_iconv_convenience(lp_ctx), ev); if (!msg) { exit(1); }
