diff options
Diffstat (limited to 'source4/ntvfs')
-rw-r--r-- | source4/ntvfs/ipc/ipc_rap.c | 26 | ||||
-rw-r--r-- | source4/ntvfs/ipc/rap_server.c | 4 | ||||
-rw-r--r-- | source4/ntvfs/ipc/vfs_ipc.c | 2 | ||||
-rw-r--r-- | source4/ntvfs/sysdep/sys_notify.c | 6 |
4 files changed, 20 insertions, 18 deletions
diff --git a/source4/ntvfs/ipc/ipc_rap.c b/source4/ntvfs/ipc/ipc_rap.c index 85bc5c212f..faf48705c4 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 7d3020a259..633f0bf36e 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 b69fb98c5d..81cd984f0b 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; diff --git a/source4/ntvfs/sysdep/sys_notify.c b/source4/ntvfs/sysdep/sys_notify.c index 2ed9908af7..84ba745f5b 100644 --- a/source4/ntvfs/sysdep/sys_notify.c +++ b/source4/ntvfs/sysdep/sys_notify.c @@ -126,17 +126,11 @@ _PUBLIC_ NTSTATUS sys_notify_init(void) static bool initialized = false; init_module_fn static_init[] = { STATIC_sys_notify_MODULES }; - init_module_fn *shared_init; if (initialized) return NT_STATUS_OK; initialized = true; - shared_init = load_samba_modules(NULL, global_loadparm, "sys_notify"); - run_init_functions(static_init); - run_init_functions(shared_init); - - talloc_free(shared_init); return NT_STATUS_OK; } |