diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-12-13 22:46:55 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2007-12-21 05:50:08 +0100 |
commit | e31abef15f7696cf39e9e81307f153da93568e02 (patch) | |
tree | 1cc4d50c7b25b8471399d4f0b971145e13519f2f /source4 | |
parent | 27b21a386ebeed66dd804a8b2e2256b739e32543 (diff) | |
download | samba-e31abef15f7696cf39e9e81307f153da93568e02.tar.gz samba-e31abef15f7696cf39e9e81307f153da93568e02.tar.bz2 samba-e31abef15f7696cf39e9e81307f153da93568e02.zip |
r26440: Remove more uses of global_loadparm.
(This used to be commit 8858cf39722f192865e531164c72039fd18d7a8d)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/rpc/dcerpc_util.c | 4 | ||||
-rw-r--r-- | source4/ntvfs/common/notify.c | 3 | ||||
-rw-r--r-- | source4/ntvfs/ipc/rap_server.c | 2 | ||||
-rw-r--r-- | source4/ntvfs/posix/vfs_posix.c | 1 | ||||
-rw-r--r-- | source4/param/share.c | 3 | ||||
-rw-r--r-- | source4/param/share.h | 3 | ||||
-rw-r--r-- | source4/param/share_classic.c | 3 | ||||
-rw-r--r-- | source4/param/share_ldb.c | 9 | ||||
-rw-r--r-- | source4/param/tests/share.c | 4 | ||||
-rw-r--r-- | source4/rpc_server/dcerpc_server.c | 4 | ||||
-rw-r--r-- | source4/rpc_server/dcesrv_auth.c | 2 | ||||
-rw-r--r-- | source4/rpc_server/srvsvc/dcesrv_srvsvc.c | 16 | ||||
-rw-r--r-- | source4/rpc_server/srvsvc/srvsvc_ntvfs.c | 2 | ||||
-rw-r--r-- | source4/smb_server/smb_server.c | 2 |
14 files changed, 32 insertions, 26 deletions
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c index b8fcfb904a..ecc6f19e8c 100644 --- a/source4/librpc/rpc/dcerpc_util.c +++ b/source4/librpc/rpc/dcerpc_util.c @@ -439,7 +439,7 @@ NTSTATUS dcerpc_parse_binding(TALLOC_CTX *mem_ctx, const char *s, struct dcerpc_ NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_syntax_id *syntax) { TALLOC_CTX *mem_ctx = talloc_init("floor_get_lhs_data"); - struct ndr_pull *ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx, lp_iconv_convenience(global_loadparm)); + struct ndr_pull *ndr = ndr_pull_init_blob(&epm_floor->lhs.lhs_data, mem_ctx, NULL); enum ndr_err_code ndr_err; uint16_t if_version=0; @@ -466,7 +466,7 @@ NTSTATUS dcerpc_floor_get_lhs_data(struct epm_floor *epm_floor, struct ndr_synta static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax) { - struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx, lp_iconv_convenience(global_loadparm)); + struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx, NULL); ndr->flags |= LIBNDR_FLAG_NOALIGN; diff --git a/source4/ntvfs/common/notify.c b/source4/ntvfs/common/notify.c index 187a349b4b..8bbf2d04b3 100644 --- a/source4/ntvfs/common/notify.c +++ b/source4/ntvfs/common/notify.c @@ -82,6 +82,7 @@ static int notify_destructor(struct notify_context *notify) */ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server, struct messaging_context *messaging_ctx, + struct loadparm_context *lp_ctx, struct event_context *ev, struct share_config *scfg) { @@ -96,7 +97,7 @@ struct notify_context *notify_init(TALLOC_CTX *mem_ctx, struct server_id server, return NULL; } - notify->w = cluster_tdb_tmp_open(notify, global_loadparm, "notify.tdb", TDB_SEQNUM); + notify->w = cluster_tdb_tmp_open(notify, lp_ctx, "notify.tdb", TDB_SEQNUM); if (notify->w == NULL) { talloc_free(notify); return NULL; diff --git a/source4/ntvfs/ipc/rap_server.c b/source4/ntvfs/ipc/rap_server.c index 9113bef894..7d3020a259 100644 --- a/source4/ntvfs/ipc/rap_server.c +++ b/source4/ntvfs/ipc/rap_server.c @@ -41,7 +41,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), &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(global_loadparm), global_loadparm, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return nterr; } diff --git a/source4/ntvfs/posix/vfs_posix.c b/source4/ntvfs/posix/vfs_posix.c index 8e5e5a6942..e058e6f546 100644 --- a/source4/ntvfs/posix/vfs_posix.c +++ b/source4/ntvfs/posix/vfs_posix.c @@ -214,6 +214,7 @@ static NTSTATUS pvfs_connect(struct ntvfs_module_context *ntvfs, pvfs->notify_context = notify_init(pvfs, pvfs->ntvfs->ctx->server_id, pvfs->ntvfs->ctx->msg_ctx, + pvfs->ntvfs->ctx->lp_ctx, event_context_find(pvfs), pvfs->ntvfs->ctx->config); diff --git a/source4/param/share.c b/source4/param/share.c index 4b747f85ae..2ada9999ea 100644 --- a/source4/param/share.c +++ b/source4/param/share.c @@ -127,6 +127,7 @@ NTSTATUS share_register(const struct share_ops *ops) } NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, const char *backend_name, + struct loadparm_context *lp_ctx, struct share_context **ctx) { const struct share_ops *ops; @@ -137,7 +138,7 @@ NTSTATUS share_get_context_by_name(TALLOC_CTX *mem_ctx, const char *backend_name return NT_STATUS_INTERNAL_ERROR; } - return ops->init(mem_ctx, ops, ctx); + return ops->init(mem_ctx, ops, lp_ctx, ctx); } /* diff --git a/source4/param/share.h b/source4/param/share.h index fae1c31c13..51f45781c1 100644 --- a/source4/param/share.h +++ b/source4/param/share.h @@ -49,7 +49,8 @@ struct share_info { struct share_ops { const char *name; - NTSTATUS (*init)(TALLOC_CTX *, const struct share_ops*, struct share_context **); + NTSTATUS (*init)(TALLOC_CTX *, const struct share_ops*, struct loadparm_context *lp_ctx, + struct share_context **); const char *(*string_option)(struct share_config *, const char *, const char *); int (*int_option)(struct share_config *, const char *, int); bool (*bool_option)(struct share_config *, const char *, bool); diff --git a/source4/param/share_classic.c b/source4/param/share_classic.c index 4a7fbcb263..b517c9c4c2 100644 --- a/source4/param/share_classic.c +++ b/source4/param/share_classic.c @@ -25,6 +25,7 @@ static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, + struct loadparm_context *lp_ctx, struct share_context **ctx) { *ctx = talloc(mem_ctx, struct share_context); @@ -34,7 +35,7 @@ static NTSTATUS sclassic_init(TALLOC_CTX *mem_ctx, } (*ctx)->ops = ops; - (*ctx)->priv_data = global_loadparm; + (*ctx)->priv_data = lp_ctx; return NT_STATUS_OK; } diff --git a/source4/param/share_ldb.c b/source4/param/share_ldb.c index 487359eff6..bdea94a5cd 100644 --- a/source4/param/share_ldb.c +++ b/source4/param/share_ldb.c @@ -27,7 +27,8 @@ #include "param/share.h" #include "param/param.h" -static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, struct share_context **ctx) +static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, struct loadparm_context *lp_ctx, + struct share_context **ctx) { struct ldb_context *sdb; @@ -37,9 +38,9 @@ static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, stru return NT_STATUS_NO_MEMORY; } - sdb = ldb_wrap_connect(*ctx, global_loadparm, - private_path(*ctx, global_loadparm, "share.ldb"), - system_session(*ctx, global_loadparm), + sdb = ldb_wrap_connect(*ctx, lp_ctx, + private_path(*ctx, lp_ctx, "share.ldb"), + system_session(*ctx, lp_ctx), NULL, 0, NULL); if (!sdb) { diff --git a/source4/param/tests/share.c b/source4/param/tests/share.c index 1f8ecb2d84..390da9dede 100644 --- a/source4/param/tests/share.c +++ b/source4/param/tests/share.c @@ -178,12 +178,12 @@ static void tcase_add_share_tests(struct torture_tcase *tcase) static bool setup_ldb(struct torture_context *tctx, void **data) { - return NT_STATUS_IS_OK(share_get_context_by_name(tctx, "ldb", (struct share_context **)data)); + return NT_STATUS_IS_OK(share_get_context_by_name(tctx, "ldb", tctx->lp_ctx, (struct share_context **)data)); } static bool setup_classic(struct torture_context *tctx, void **data) { - return NT_STATUS_IS_OK(share_get_context_by_name(tctx, "classic", (struct share_context **)data)); + return NT_STATUS_IS_OK(share_get_context_by_name(tctx, "classic", tctx->lp_ctx, (struct share_context **)data)); } static bool teardown(struct torture_context *tctx, void *data) diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c index cf89143b34..b043424faa 100644 --- a/source4/rpc_server/dcerpc_server.c +++ b/source4/rpc_server/dcerpc_server.c @@ -822,7 +822,7 @@ static NTSTATUS dcesrv_request(struct dcesrv_call_state *call) } pull = ndr_pull_init_blob(&call->pkt.u.request.stub_and_verifier, call, - lp_iconv_convenience(global_loadparm)); + lp_iconv_convenience(call->conn->dce_ctx->lp_ctx)); NT_STATUS_HAVE_NO_MEMORY(pull); pull->flags |= LIBNDR_FLAG_REF_ALLOC; @@ -885,7 +885,7 @@ _PUBLIC_ NTSTATUS dcesrv_reply(struct dcesrv_call_state *call) } /* form the reply NDR */ - push = ndr_push_init_ctx(call, lp_iconv_convenience(global_loadparm)); + push = ndr_push_init_ctx(call, lp_iconv_convenience(call->conn->dce_ctx->lp_ctx)); NT_STATUS_HAVE_NO_MEMORY(push); /* carry over the pointer count to the reply in case we are diff --git a/source4/rpc_server/dcesrv_auth.c b/source4/rpc_server/dcesrv_auth.c index b32481a1b7..aa37de2826 100644 --- a/source4/rpc_server/dcesrv_auth.c +++ b/source4/rpc_server/dcesrv_auth.c @@ -406,7 +406,7 @@ bool dcesrv_auth_response(struct dcesrv_call_state *call, return NT_STATUS_IS_OK(status); } - ndr = ndr_push_init_ctx(call, lp_iconv_convenience(global_loadparm)); + ndr = ndr_push_init_ctx(call, lp_iconv_convenience(dce_conn->dce_ctx->lp_ctx)); if (!ndr) { return false; } diff --git a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c index b9e097356a..ebbeb2d0df 100644 --- a/source4/rpc_server/srvsvc/dcesrv_srvsvc.c +++ b/source4/rpc_server/srvsvc/dcesrv_srvsvc.c @@ -444,7 +444,7 @@ static WERROR dcesrv_srvsvc_NetShareAdd(struct dcesrv_call_state *dce_call, TALL int count = 8; int i; - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -542,7 +542,7 @@ static WERROR dcesrv_srvsvc_NetShareAdd(struct dcesrv_call_state *dce_call, TALL int count = 10; int i; - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -734,7 +734,7 @@ static WERROR dcesrv_srvsvc_NetShareEnumAll(struct dcesrv_call_state *dce_call, /* TODO: - paging of results */ - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -983,7 +983,7 @@ static WERROR dcesrv_srvsvc_NetShareGetInfo(struct dcesrv_call_state *dce_call, return WERR_INVALID_PARAM; } - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -1237,7 +1237,7 @@ static WERROR dcesrv_srvsvc_NetShareSetInfo(struct dcesrv_call_state *dce_call, return WERR_INVALID_PARAM; } - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -1414,7 +1414,7 @@ static WERROR dcesrv_srvsvc_NetShareCheck(struct dcesrv_call_state *dce_call, TA } all_string_sub(device, "\\", "/", 0); - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -1828,7 +1828,7 @@ static WERROR dcesrv_srvsvc_NetShareEnum(struct dcesrv_call_state *dce_call, TAL /* TODO: - paging of results */ - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } @@ -2291,7 +2291,7 @@ static WERROR dcesrv_srvsvc_NetShareDel(struct dcesrv_call_state *dce_call, TALL NTSTATUS nterr; struct share_context *sctx; - nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx); + nterr = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(nterr)) { return ntstatus_to_werror(nterr); } diff --git a/source4/rpc_server/srvsvc/srvsvc_ntvfs.c b/source4/rpc_server/srvsvc/srvsvc_ntvfs.c index c9c8e2e820..ccd6c4f74e 100644 --- a/source4/rpc_server/srvsvc/srvsvc_ntvfs.c +++ b/source4/rpc_server/srvsvc/srvsvc_ntvfs.c @@ -62,7 +62,7 @@ NTSTATUS srvsvc_create_ntvfs_context(struct dcesrv_call_state *dce_call, struct share_config *scfg; const char *sharetype; - status = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), &sctx); + status = share_get_context_by_name(mem_ctx, lp_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->conn->dce_ctx->lp_ctx, &sctx); if (!NT_STATUS_IS_OK(status)) { return status; } diff --git a/source4/smb_server/smb_server.c b/source4/smb_server/smb_server.c index bc17d100c5..082de6540b 100644 --- a/source4/smb_server/smb_server.c +++ b/source4/smb_server/smb_server.c @@ -157,7 +157,7 @@ static void smbsrv_accept(struct stream_connection *conn) smbsrv_management_init(smb_conn); if (!NT_STATUS_IS_OK(share_get_context_by_name(smb_conn, lp_share_backend(smb_conn->lp_ctx), - &(smb_conn->share_context)))) { + smb_conn->lp_ctx, &(smb_conn->share_context)))) { smbsrv_terminate_connection(smb_conn, "share_init failed!"); return; } |