diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-03-15 17:28:46 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:57:26 -0500 |
commit | 2e7df84576d26bc37eb87b7e3c79fcb3fb358d68 (patch) | |
tree | 2b30c038028b0a1530d0236fa196efaa3d63b0f5 /source4/ntvfs/ntvfs_base.c | |
parent | 84aea6eca58b20f32fad0de0f43d9a5c7de247c9 (diff) | |
download | samba-2e7df84576d26bc37eb87b7e3c79fcb3fb358d68.tar.gz |
r14456: don't access the smbsrv_tcon inside the ntvfs modules
metze
(This used to be commit 5709c1c4e1a561dd9af98cfefbbbdac9b18765b7)
Diffstat (limited to 'source4/ntvfs/ntvfs_base.c')
-rw-r--r-- | source4/ntvfs/ntvfs_base.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/source4/ntvfs/ntvfs_base.c b/source4/ntvfs/ntvfs_base.c index 7351d6b2a66..5abf449b8c7 100644 --- a/source4/ntvfs/ntvfs_base.c +++ b/source4/ntvfs/ntvfs_base.c @@ -118,9 +118,12 @@ _PUBLIC_ const struct ntvfs_critical_sizes *ntvfs_interface_version(void) /* initialise a connection structure to point at a NTVFS backend */ -NTSTATUS ntvfs_init_connection(struct ntvfs_request *req, enum ntvfs_type type) +NTSTATUS ntvfs_init_connection(TALLOC_CTX *mem_ctx, int snum, enum ntvfs_type type, + enum protocol_types protocol, + struct event_context *ev, struct messaging_context *msg, + uint32_t server_id, struct ntvfs_context **_ctx) { - const char **handlers = lp_ntvfs_handler(req->tcon->service); + const char **handlers = lp_ntvfs_handler(snum); int i; struct ntvfs_context *ctx; @@ -128,19 +131,21 @@ NTSTATUS ntvfs_init_connection(struct ntvfs_request *req, enum ntvfs_type type) return NT_STATUS_INTERNAL_ERROR; } - ctx = talloc(req->tcon, struct ntvfs_context); + ctx = talloc_zero(mem_ctx, struct ntvfs_context); NT_STATUS_HAVE_NO_MEMORY(ctx); - ctx->type = type; - ctx->modules = NULL; + ctx->protocol = protocol; + ctx->type = type; + ctx->config.snum = snum; + ctx->event_ctx = ev; + ctx->msg_ctx = msg; + ctx->server_id = server_id; for (i=0; handlers[i]; i++) { struct ntvfs_module_context *ntvfs; - ntvfs = talloc(ctx, struct ntvfs_module_context); + ntvfs = talloc_zero(ctx, struct ntvfs_module_context); NT_STATUS_HAVE_NO_MEMORY(ntvfs); - - ntvfs->private_data = NULL; - + ntvfs->ctx = ctx; ntvfs->ops = ntvfs_backend_byname(handlers[i], ctx->type); if (!ntvfs->ops) { DEBUG(1,("ntvfs_init_connection: failed to find backend=%s, type=%d\n", @@ -155,8 +160,7 @@ NTSTATUS ntvfs_init_connection(struct ntvfs_request *req, enum ntvfs_type type) return NT_STATUS_INTERNAL_ERROR; } - req->tcon->ntvfs_ctx = ctx; - + *_ctx = ctx; return NT_STATUS_OK; } |