s4: ntvfs: Add a TALLOC_CTX * paramter to pvfs_acl_register()
authorJeremy Allison <jra@samba.org>
Thu, 11 May 2017 22:45:57 +0000 (15:45 -0700)
committerRalph Boehme <slow@samba.org>
Sat, 13 May 2017 14:50:13 +0000 (16:50 +0200)
Make use of the passed in TALLOC_CTX * from the init function
to remove a talloc_autofree_context() use.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/pvfs_acl_nfs4.c
source4/ntvfs/posix/pvfs_acl_xattr.c

index 9a110caf236f9f5b81da5011b7086ad8132b423d..d284585f260a2d03d50fd0c49c96ad7aaf937419 100644 (file)
@@ -41,7 +41,7 @@ static int num_backends;
   The 'name' can be later used by other backends to find the operations
   structure for this backend.  
 */
-NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops)
+NTSTATUS pvfs_acl_register(TALLOC_CTX *ctx, const struct pvfs_acl_ops *ops)
 {
        struct pvfs_acl_ops *new_ops;
 
@@ -50,7 +50,8 @@ NTSTATUS pvfs_acl_register(const struct pvfs_acl_ops *ops)
                return NT_STATUS_OBJECT_NAME_COLLISION;
        }
 
-       backends = talloc_realloc(talloc_autofree_context(), backends, struct pvfs_acl_backend, num_backends+1);
+       backends = talloc_realloc(ctx, backends,
+                       struct pvfs_acl_backend, num_backends+1);
        NT_STATUS_HAVE_NO_MEMORY(backends);
 
        new_ops = (struct pvfs_acl_ops *)talloc_memdup(backends, ops, sizeof(*ops));
index 392dc92fe1229480a50ac92b6259814c8f4dc5f6..b07d2ba9b41bf66f74ac0fc68c35d047e46f415c 100644 (file)
@@ -195,5 +195,5 @@ NTSTATUS pvfs_acl_nfs4_init(TALLOC_CTX *ctx)
                .acl_load = pvfs_acl_load_nfs4,
                .acl_save = pvfs_acl_save_nfs4
        };
-       return pvfs_acl_register(&ops);
+       return pvfs_acl_register(ctx, &ops);
 }
index 648c459dadd7ab4a74a4e67ebd378c15f3351440..1f569ca43f368811a10ac88909963dbe34776282 100644 (file)
@@ -100,5 +100,5 @@ NTSTATUS pvfs_acl_xattr_init(TALLOC_CTX *ctx)
                .acl_load = pvfs_acl_load_xattr,
                .acl_save = pvfs_acl_save_xattr
        };
-       return pvfs_acl_register(&ops);
+       return pvfs_acl_register(ctx, &ops);
 }