diff options
author | Björn Baumbach <bb@sernet.de> | 2012-06-14 14:15:44 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2012-06-15 18:32:21 +0200 |
commit | 289255ce7379188177eaa5f4f8fa527cb909af24 (patch) | |
tree | c40e0ba114ddd46ef000c78e6338b29ef5853998 | |
parent | 442cb66c16d50e76725799aa74a8877207de88ec (diff) | |
download | samba-289255ce7379188177eaa5f4f8fa527cb909af24.tar.gz samba-289255ce7379188177eaa5f4f8fa527cb909af24.tar.bz2 samba-289255ce7379188177eaa5f4f8fa527cb909af24.zip |
s3:vfs_gpfs: add "gpfs:acl" option
With "gpfs:acl=no" you can pass the acl calls to the next SMB_VFS module.
Based on a patch from Hans-Dieter Schuster <hans-dieter.schuster@ts.fujitsu.com>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/modules/vfs_gpfs.c | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 4b0f9ebaf7..d4009c44d8 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -45,6 +45,7 @@ struct gpfs_config_data { bool getrealfilename; bool dfreequota; bool prealloc; + bool acl; }; @@ -350,8 +351,18 @@ static NTSTATUS gpfsacl_fget_nt_acl(vfs_handle_struct *handle, { SMB4ACL_T *pacl = NULL; int result; + struct gpfs_config_data *config; *ppdesc = NULL; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return NT_STATUS_INTERNAL_ERROR); + + if (!config->acl) { + return SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc); + } + result = gpfs_get_nfs4_acl(fsp->fsp_name->base_name, &pacl); if (result == 0) @@ -372,8 +383,18 @@ static NTSTATUS gpfsacl_get_nt_acl(vfs_handle_struct *handle, { SMB4ACL_T *pacl = NULL; int result; + struct gpfs_config_data *config; *ppdesc = NULL; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return NT_STATUS_INTERNAL_ERROR); + + if (!config->acl) { + return SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc); + } + result = gpfs_get_nfs4_acl(name, &pacl); if (result == 0) @@ -514,6 +535,16 @@ static NTSTATUS gpfsacl_set_nt_acl_internal(files_struct *fsp, uint32 security_i static NTSTATUS gpfsacl_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd) { + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return NT_STATUS_INTERNAL_ERROR); + + if (!config->acl) { + return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd); + } + return gpfsacl_set_nt_acl_internal(fsp, security_info_sent, psd); } @@ -627,6 +658,15 @@ static SMB_ACL_T gpfsacl_sys_acl_get_file(vfs_handle_struct *handle, SMB_ACL_TYPE_T type) { gpfs_aclType_t gpfs_type; + 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_GET_FILE(handle, path_p, type); + } switch(type) { case SMB_ACL_TYPE_ACCESS: @@ -646,6 +686,16 @@ static SMB_ACL_T gpfsacl_sys_acl_get_file(vfs_handle_struct *handle, static SMB_ACL_T gpfsacl_sys_acl_get_fd(vfs_handle_struct *handle, files_struct *fsp) { + 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_GET_FD(handle, fsp); + } + return gpfsacl_get_posix_acl(fsp->fsp_name->base_name, GPFS_ACL_TYPE_ACCESS); } @@ -744,6 +794,15 @@ static int gpfsacl_sys_acl_set_file(vfs_handle_struct *handle, { struct gpfs_acl *gpfs_acl; int result; + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); + + if (!config->acl) { + return SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, type, theacl); + } gpfs_acl = smb2gpfs_acl(theacl, type); if (gpfs_acl == NULL) { @@ -760,6 +819,16 @@ static int gpfsacl_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl) { + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); + + if (!config->acl) { + return SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl); + } + return gpfsacl_sys_acl_set_file(handle, fsp->fsp_name->base_name, SMB_ACL_TYPE_ACCESS, theacl); } @@ -767,6 +836,16 @@ static int gpfsacl_sys_acl_set_fd(vfs_handle_struct *handle, static int gpfsacl_sys_acl_delete_def_file(vfs_handle_struct *handle, const char *path) { + struct gpfs_config_data *config; + + SMB_VFS_HANDLE_GET_DATA(handle, config, + struct gpfs_config_data, + return -1); + + if (!config->acl) { + return SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path); + } + errno = ENOTSUP; return -1; } @@ -1425,6 +1504,8 @@ static int vfs_gpfs_connect(struct vfs_handle_struct *handle, config->prealloc = lp_parm_bool(SNUM(handle->conn), "gpfs", "prealloc", true); + config->acl = lp_parm_bool(SNUM(handle->conn), "gpfs", "acl", true); + SMB_VFS_HANDLE_SET_DATA(handle, config, NULL, struct gpfs_config_data, return -1); |