if vfs_cifs want to modify the ntvfs_ops struct, it should
authorStefan Metzmacher <metze@samba.org>
Tue, 3 Feb 2004 12:37:54 +0000 (12:37 +0000)
committerStefan Metzmacher <metze@samba.org>
Tue, 3 Feb 2004 12:37:54 +0000 (12:37 +0000)
use a temporary copy of the struct!

metze

source/ntvfs/cifs/vfs_cifs.c

index 976fa96b55b4fdbd4a8c8a2f5caad0afc8b025b9..878dbf2357f1315972fa49ac4ec4efec6d543e17 100644 (file)
@@ -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