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_posixacl.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_posixacl.c')
-rw-r--r-- | source3/modules/vfs_posixacl.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source3/modules/vfs_posixacl.c b/source3/modules/vfs_posixacl.c index 50487ff4de..1714b137d6 100644 --- a/source3/modules/vfs_posixacl.c +++ b/source3/modules/vfs_posixacl.c @@ -26,7 +26,7 @@ static bool smb_ace_to_internal(acl_entry_t posix_ace, struct smb_acl_entry *ace); -static struct smb_acl_t *smb_acl_to_internal(acl_t acl); +static struct smb_acl_t *smb_acl_to_internal(acl_t acl, TALLOC_CTX *mem_ctx); static int smb_acl_set_mode(acl_entry_t entry, SMB_ACL_PERM_T perm); static acl_t smb_acl_to_posix(const struct smb_acl_t *acl); @@ -35,7 +35,8 @@ static acl_t smb_acl_to_posix(const struct smb_acl_t *acl); SMB_ACL_T posixacl_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 acl_type; @@ -59,13 +60,13 @@ SMB_ACL_T posixacl_sys_acl_get_file(vfs_handle_struct *handle, return NULL; } - result = smb_acl_to_internal(acl); + result = smb_acl_to_internal(acl, mem_ctx); acl_free(acl); return result; } SMB_ACL_T posixacl_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 acl = acl_get_fd(fsp->fh->fd); @@ -74,7 +75,7 @@ SMB_ACL_T posixacl_sys_acl_get_fd(vfs_handle_struct *handle, return NULL; } - result = smb_acl_to_internal(acl); + result = smb_acl_to_internal(acl, mem_ctx); acl_free(acl); return result; } @@ -212,9 +213,9 @@ static bool smb_ace_to_internal(acl_entry_t posix_ace, return True; } -static struct smb_acl_t *smb_acl_to_internal(acl_t acl) +static struct smb_acl_t *smb_acl_to_internal(acl_t acl, TALLOC_CTX *mem_ctx) { - struct smb_acl_t *result = sys_acl_init(); + struct smb_acl_t *result = sys_acl_init(mem_ctx); int entry_id = ACL_FIRST_ENTRY; acl_entry_t e; if (result == NULL) { |