diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-10-10 10:18:32 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-10-11 12:25:11 +1100 |
commit | 9158974540d0e311021f04789ed75ebda466c5b3 (patch) | |
tree | 5cdc75d2c7527e94df2bb9292d276cbf8e36499a /source3/modules/vfs_tru64acl.c | |
parent | a4d1f2223abdb0db2a15742ebd59a611cc157443 (diff) | |
download | samba-9158974540d0e311021f04789ed75ebda466c5b3.tar.gz samba-9158974540d0e311021f04789ed75ebda466c5b3.tar.bz2 samba-9158974540d0e311021f04789ed75ebda466c5b3.zip |
smbd: Add mem_ctx to sys_acl_init() and all callers
This changes from allocation on NULL to allocation on the supplied
memory context.
Currently that supplied context is talloc_tos() at the the final consumer of
the ACL.
Andrew Bartlett
Diffstat (limited to 'source3/modules/vfs_tru64acl.c')
-rw-r--r-- | source3/modules/vfs_tru64acl.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/modules/vfs_tru64acl.c b/source3/modules/vfs_tru64acl.c index 918f7c6d00..6eadee613c 100644 --- a/source3/modules/vfs_tru64acl.c +++ b/source3/modules/vfs_tru64acl.c @@ -24,7 +24,8 @@ /* prototypes for private functions first - for clarity */ -static struct smb_acl_t *tru64_acl_to_smb_acl(const struct acl *tru64_acl); +static struct smb_acl_t *tru64_acl_to_smb_acl(const struct acl *tru64_acl, + TALLOC_CTX *mem_ctx); static bool tru64_ace_to_smb_ace(acl_entry_t tru64_ace, struct smb_acl_entry *smb_ace); static acl_t smb_acl_to_tru64_acl(const SMB_ACL_T smb_acl); @@ -38,7 +39,8 @@ static SMB_ACL_PERM_T tru64_permset_to_smb(const acl_perm_t tru64_permset); SMB_ACL_T tru64acl_sys_acl_get_file(vfs_handle_struct *handle, const char *path_p, - SMB_ACL_TYPE_T type) + SMB_ACL_TYPE_T type, + TALLOC_CTX *mem_ctx) { struct smb_acl_t *result; acl_type_t the_acl_type; @@ -64,13 +66,14 @@ SMB_ACL_T tru64acl_sys_acl_get_file(vfs_handle_struct *handle, return NULL; } - result = tru64_acl_to_smb_acl(tru64_acl); + result = tru64_acl_to_smb_acl(tru64_acl, mem_ctx); acl_free(tru64_acl); return result; } SMB_ACL_T tru64acl_sys_acl_get_fd(vfs_handle_struct *handle, - files_struct *fsp) + files_struct *fsp, + TALLOC_CTX *mem_ctx) { struct smb_acl_t *result; acl_t tru64_acl = acl_get_fd(fsp->fh->fd, ACL_TYPE_ACCESS); @@ -79,7 +82,7 @@ SMB_ACL_T tru64acl_sys_acl_get_fd(vfs_handle_struct *handle, return NULL; } - result = tru64_acl_to_smb_acl(tru64_acl); + result = tru64_acl_to_smb_acl(tru64_acl, mem_ctx); acl_free(tru64_acl); return result; } @@ -153,14 +156,15 @@ int tru64acl_sys_acl_delete_def_file(vfs_handle_struct *handle, /* private functions */ -static struct smb_acl_t *tru64_acl_to_smb_acl(const struct acl *tru64_acl) +static struct smb_acl_t *tru64_acl_to_smb_acl(const struct acl *tru64_acl, + TALLOC_CTX *mem_ctx) { struct smb_acl_t *result; acl_entry_t entry; DEBUG(10, ("Hi! This is tru64_acl_to_smb_acl.\n")); - if ((result = sys_acl_init()) == NULL) { + if ((result = sys_acl_init(mem_ctx)) == NULL) { DEBUG(0, ("sys_acl_init() failed in tru64_acl_to_smb_acl\n")); errno = ENOMEM; goto fail; |