diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-10-10 16:58:59 +1100 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-10-11 12:25:12 +1100 |
commit | abee79f99db802adc8e13a2baedf7817bf937786 (patch) | |
tree | ea0428141677464f987bc6d5a6cbc3d7b7382c03 /source3 | |
parent | 5dddd9429e9b08b3d88ed6ba8fc86ec837ef23d8 (diff) | |
download | samba-abee79f99db802adc8e13a2baedf7817bf937786.tar.gz samba-abee79f99db802adc8e13a2baedf7817bf937786.tar.bz2 samba-abee79f99db802adc8e13a2baedf7817bf937786.zip |
vfs: Use posix_sys_acl_blob_get_file in vfs_gpfs for posix ACLs
Diffstat (limited to 'source3')
-rw-r--r-- | source3/modules/vfs_gpfs.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 5ab5d4a2ad..b3cdca5cd8 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -709,6 +709,62 @@ static SMB_ACL_T gpfsacl_sys_acl_get_fd(vfs_handle_struct *handle, GPFS_ACL_TYPE_ACCESS, mem_ctx); } +static int gpfsacl_sys_acl_blob_get_file(vfs_handle_struct *handle, const char *path_p, + TALLOC_CTX *mem_ctx, + char **blob_description, + DATA_BLOB *blob) +{ + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return NULL); + + if (!config->acl) { + return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FILE(handle, path_p, mem_ctx, blob_description, blob); + } + + result = gpfs_get_nfs4_acl(name, &pacl); + if (result == 0) { + /* We don't have a way to linearlise the NFS4 ACL + * right now, and it is much closer to the NT ACL + * anyway */ + errno = EINVAL; + return -1; + } + + return posix_sys_acl_blob_get_file(handle, path_p, mem_ctx, + blob_description, blob); +} + +static int gpfsacl_sys_acl_blob_get_fd(vfs_handle_struct *handle, files_struct *fsp, + TALLOC_CTX *mem_ctx, + char **blob_description, + DATA_BLOB *blob) +{ + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return NULL); + + if (!config->acl) { + return SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx, blob_description, blob); + } + + result = gpfs_get_nfs4_acl(fsp->fsp_name->base_name, &pacl); + if (result == 0) { + /* We don't have a way to linearlise the NFS4 ACL + * right now, and it is much closer to the NT ACL + * anyway */ + errno = EINVAL; + return -1; + } + + return posix_sys_acl_blob_get_fd(handle, fsp, mem_ctx, + blob_description, blob); +} + static struct gpfs_acl *smb2gpfs_acl(const SMB_ACL_T pacl, SMB_ACL_TYPE_T type) { @@ -1916,6 +1972,8 @@ static struct vfs_fn_pointers vfs_gpfs_fns = { .fset_nt_acl_fn = gpfsacl_fset_nt_acl, .sys_acl_get_file_fn = gpfsacl_sys_acl_get_file, .sys_acl_get_fd_fn = gpfsacl_sys_acl_get_fd, + .sys_acl_blob_get_file_fn = gpfsacl_sys_acl_blob_get_file, + .sys_acl_blob_get_fd_fn = gpfsacl_sys_acl_blob_get_fd, .sys_acl_set_file_fn = gpfsacl_sys_acl_set_file, .sys_acl_set_fd_fn = gpfsacl_sys_acl_set_fd, .sys_acl_delete_def_file_fn = gpfsacl_sys_acl_delete_def_file, |