From f848aff0c28fcbacb4290e67b7c217b1aaa0fade Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 3 Feb 2004 12:37:54 +0000 Subject: if vfs_cifs want to modify the ntvfs_ops struct, it should use a temporary copy of the struct! metze (This used to be commit 372522c64f2aea76b3fe136752d4da40e61d2bec) --- source4/ntvfs/cifs/vfs_cifs.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4/ntvfs') diff --git a/source4/ntvfs/cifs/vfs_cifs.c b/source4/ntvfs/cifs/vfs_cifs.c index 976fa96b55..878dbf2357 100644 --- a/source4/ntvfs/cifs/vfs_cifs.c +++ b/source4/ntvfs/cifs/vfs_cifs.c @@ -148,7 +148,12 @@ static NTSTATUS cvfs_connect(struct request_context *req, const char *sharename) /* if we are mapping trans2, then we need to not give a trans2 pointer in the operations structure */ if (private->map_calls && in_list("trans2", private->map_calls, True)) { - conn->ntvfs_ops->trans2 = NULL; + struct ntvfs_ops *ops = talloc_memdup(conn->mem_ctx,conn->ntvfs_ops,sizeof(*ops)); + if (!ops) { + return NT_STATUS_NO_MEMORY; + } + ops->trans2 = NULL; + conn->ntvfs_ops = ops; } /* we need to tell the event loop that we wish to receive read events -- cgit