1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

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
This commit is contained in:
Andrew Bartlett
2012-10-10 11:50:27 +11:00
parent 9158974540
commit c8ade07760
25 changed files with 244 additions and 129 deletions

View File

@ -2039,12 +2039,14 @@ static void vfswrap_strict_unlock(struct vfs_handle_struct *handle,
static NTSTATUS vfswrap_fget_nt_acl(vfs_handle_struct *handle,
files_struct *fsp,
uint32 security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc)
{
NTSTATUS result;
START_PROFILE(fget_nt_acl);
result = posix_fget_nt_acl(fsp, security_info, ppdesc);
result = posix_fget_nt_acl(fsp, security_info,
mem_ctx, ppdesc);
END_PROFILE(fget_nt_acl);
return result;
}
@ -2052,12 +2054,14 @@ static NTSTATUS vfswrap_fget_nt_acl(vfs_handle_struct *handle,
static NTSTATUS vfswrap_get_nt_acl(vfs_handle_struct *handle,
const char *name,
uint32 security_info,
TALLOC_CTX *mem_ctx,
struct security_descriptor **ppdesc)
{
NTSTATUS result;
START_PROFILE(get_nt_acl);
result = posix_get_nt_acl(handle->conn, name, security_info, ppdesc);
result = posix_get_nt_acl(handle->conn, name, security_info,
mem_ctx, ppdesc);
END_PROFILE(get_nt_acl);
return result;
}