summaryrefslogtreecommitdiff
path: root/source4/ntvfs/ipc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-01-05 19:03:43 -0600
committerStefan Metzmacher <metze@samba.org>2008-01-05 13:06:03 -0600
commitdf408d056ec03f2abe08ce0ea487e1875b90e7bf (patch)
tree68cb7b83f12d50d8536acef9c1fed74d22ad9f54 /source4/ntvfs/ipc
parent01c79091924602bb5c3f1c0c823b2577c4708f6a (diff)
downloadsamba-df408d056ec03f2abe08ce0ea487e1875b90e7bf.tar.gz
r26672: Janitorial: Remove uses of global_loadparm.
(This used to be commit 18cd08623eaad7d2cd63b82ea5275d4dfd21cf00)
Diffstat (limited to 'source4/ntvfs/ipc')
-rw-r--r--source4/ntvfs/ipc/ipc_rap.c26
-rw-r--r--source4/ntvfs/ipc/rap_server.c4
-rw-r--r--source4/ntvfs/ipc/vfs_ipc.c2
3 files changed, 20 insertions, 12 deletions
diff --git a/source4/ntvfs/ipc/ipc_rap.c b/source4/ntvfs/ipc/ipc_rap.c
index 85bc5c212f7..faf48705c46 100644
--- a/source4/ntvfs/ipc/ipc_rap.c
+++ b/source4/ntvfs/ipc/ipc_rap.c
@@ -82,6 +82,8 @@ static void rap_heap_restore(struct rap_string_heap *heap,
}
struct rap_call {
+ struct loadparm_context *lp_ctx;
+
TALLOC_CTX *mem_ctx;
uint16_t callno;
const char *paramdesc;
@@ -103,6 +105,7 @@ struct rap_call {
#define RAPNDR_FLAGS (LIBNDR_FLAG_NOALIGN|LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_NULLTERM);
static struct rap_call *new_rap_srv_call(TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx,
struct smb_trans2 *trans)
{
struct rap_call *call;
@@ -114,12 +117,14 @@ static struct rap_call *new_rap_srv_call(TALLOC_CTX *mem_ctx,
ZERO_STRUCTP(call);
+ call->lp_ctx = talloc_reference(call, lp_ctx);
+
call->mem_ctx = mem_ctx;
- call->ndr_pull_param = ndr_pull_init_blob(&trans->in.params, mem_ctx, lp_iconv_convenience(global_loadparm));
+ call->ndr_pull_param = ndr_pull_init_blob(&trans->in.params, mem_ctx, lp_iconv_convenience(lp_ctx));
call->ndr_pull_param->flags = RAPNDR_FLAGS;
- call->ndr_pull_data = ndr_pull_init_blob(&trans->in.data, mem_ctx, lp_iconv_convenience(global_loadparm));
+ call->ndr_pull_data = ndr_pull_init_blob(&trans->in.data, mem_ctx, lp_iconv_convenience(lp_ctx));
call->ndr_pull_data->flags = RAPNDR_FLAGS;
call->heap = talloc(mem_ctx, struct rap_string_heap);
@@ -266,7 +271,7 @@ static NTSTATUS _rap_netshareenum(struct rap_call *call)
break;
}
- result = rap_netshareenum(call, &r);
+ result = rap_netshareenum(call, call->lp_ctx, &r);
if (!NT_STATUS_IS_OK(result))
return result;
@@ -348,7 +353,7 @@ static NTSTATUS _rap_netserverenum2(struct rap_call *call)
break;
}
- result = rap_netserverenum2(call, &r);
+ result = rap_netserverenum2(call, call->lp_ctx, &r);
if (!NT_STATUS_IS_OK(result))
return result;
@@ -425,7 +430,8 @@ static const struct
{NULL, -1, api_Unsupported}
};
-NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct smb_trans2 *trans)
+NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct loadparm_context *lp_ctx,
+ struct smb_trans2 *trans)
{
int i;
NTSTATUS result;
@@ -434,7 +440,7 @@ NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct smb_trans2 *trans)
struct ndr_push *final_param;
struct ndr_push *final_data;
- call = new_rap_srv_call(mem_ctx, trans);
+ call = new_rap_srv_call(mem_ctx, lp_ctx, trans);
if (call == NULL)
return NT_STATUS_NO_MEMORY;
@@ -445,8 +451,8 @@ NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct smb_trans2 *trans)
NDR_RETURN(ndr_pull_string(call->ndr_pull_param, NDR_SCALARS,
&call->datadesc));
- call->ndr_push_param = ndr_push_init_ctx(call, lp_iconv_convenience(global_loadparm));
- call->ndr_push_data = ndr_push_init_ctx(call, lp_iconv_convenience(global_loadparm));
+ call->ndr_push_param = ndr_push_init_ctx(call, lp_iconv_convenience(lp_ctx));
+ call->ndr_push_data = ndr_push_init_ctx(call, lp_iconv_convenience(lp_ctx));
if ((call->ndr_push_param == NULL) || (call->ndr_push_data == NULL))
return NT_STATUS_NO_MEMORY;
@@ -471,8 +477,8 @@ NTSTATUS ipc_rap_call(TALLOC_CTX *mem_ctx, struct smb_trans2 *trans)
result_param = ndr_push_blob(call->ndr_push_param);
result_data = ndr_push_blob(call->ndr_push_data);
- final_param = ndr_push_init_ctx(call, lp_iconv_convenience(global_loadparm));
- final_data = ndr_push_init_ctx(call, lp_iconv_convenience(global_loadparm));
+ final_param = ndr_push_init_ctx(call, lp_iconv_convenience(lp_ctx));
+ final_data = ndr_push_init_ctx(call, lp_iconv_convenience(lp_ctx));
if ((final_param == NULL) || (final_data == NULL))
return NT_STATUS_NO_MEMORY;
diff --git a/source4/ntvfs/ipc/rap_server.c b/source4/ntvfs/ipc/rap_server.c
index 7d3020a2590..633f0bf36e3 100644
--- a/source4/ntvfs/ipc/rap_server.c
+++ b/source4/ntvfs/ipc/rap_server.c
@@ -29,6 +29,7 @@
* idea. */
NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx,
struct rap_NetShareEnum *r)
{
NTSTATUS nterr;
@@ -41,7 +42,7 @@ NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx,
r->out.available = 0;
r->out.info = NULL;
- nterr = share_get_context_by_name(mem_ctx, lp_share_backend(global_loadparm), global_loadparm, &sctx);
+ nterr = share_get_context_by_name(mem_ctx, lp_share_backend(lp_ctx), lp_ctx, &sctx);
if (!NT_STATUS_IS_OK(nterr)) {
return nterr;
}
@@ -75,6 +76,7 @@ NTSTATUS rap_netshareenum(TALLOC_CTX *mem_ctx,
}
NTSTATUS rap_netserverenum2(TALLOC_CTX *mem_ctx,
+ struct loadparm_context *lp_ctx,
struct rap_NetServerEnum2 *r)
{
r->out.status = 0;
diff --git a/source4/ntvfs/ipc/vfs_ipc.c b/source4/ntvfs/ipc/vfs_ipc.c
index b69fb98c5d6..81cd984f0b5 100644
--- a/source4/ntvfs/ipc/vfs_ipc.c
+++ b/source4/ntvfs/ipc/vfs_ipc.c
@@ -805,7 +805,7 @@ static NTSTATUS ipc_trans(struct ntvfs_module_context *ntvfs,
NTSTATUS status;
if (strequal(trans->in.trans_name, "\\PIPE\\LANMAN"))
- return ipc_rap_call(req, trans);
+ return ipc_rap_call(req, ntvfs->ctx->lp_ctx, trans);
if (trans->in.setup_count != 2) {
return NT_STATUS_INVALID_PARAMETER;