From c8ade07760ae0ccfdf2d875c9f3027926e62321b Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 10 Oct 2012 11:50:27 +1100 Subject: smbd: Add mem_ctx to {f,}get_nt_acl VFS call This makes it clear which context the returned SD is allocated on, as a number of callers do not want it on talloc_tos(). As the ACL transformation allocates and then no longer needs a great deal of memory, a talloc_stackframe() call is used to contain the memory that is not returned further up the stack. Andrew Bartlett --- source3/torture/cmd_vfs.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/torture') diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c index 7755f8ac2a..a37c9fc7a7 100644 --- a/source3/torture/cmd_vfs.c +++ b/source3/torture/cmd_vfs.c @@ -1374,7 +1374,9 @@ static NTSTATUS cmd_fget_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } - status = SMB_VFS_FGET_NT_ACL(vfs->files[fd], SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL, &sd); + status = SMB_VFS_FGET_NT_ACL(vfs->files[fd], + SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL, + talloc_tos(), &sd); if (!NT_STATUS_IS_OK(status)) { printf("fget_nt_acl returned (%s)\n", nt_errstr(status)); return status; @@ -1395,7 +1397,9 @@ static NTSTATUS cmd_get_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, return NT_STATUS_OK; } - status = SMB_VFS_GET_NT_ACL(vfs->conn, argv[1], SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL, &sd); + status = SMB_VFS_GET_NT_ACL(vfs->conn, argv[1], + SECINFO_OWNER | SECINFO_GROUP | SECINFO_DACL, + talloc_tos(), &sd); if (!NT_STATUS_IS_OK(status)) { printf("get_nt_acl returned (%s)\n", nt_errstr(status)); return status; -- cgit