diff options
author | Michael Adam <obnox@samba.org> | 2007-11-16 18:33:39 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2007-12-19 23:07:58 +0100 |
commit | 010056a5e6c8b94d858575210b5544e5bbcd32b3 (patch) | |
tree | 63acb82e4adc6ff711dd377d11999b210a28ae2c /source3/modules | |
parent | c650857fac826697cb1d9441b9ea869b85190d25 (diff) | |
download | samba-010056a5e6c8b94d858575210b5544e5bbcd32b3.tar.gz samba-010056a5e6c8b94d858575210b5544e5bbcd32b3.tar.bz2 samba-010056a5e6c8b94d858575210b5544e5bbcd32b3.zip |
Prepare the gpfs acl module for the api change in get_nt_acl().
This moves functionality from gpfsacl_get_nt_acl_common()
back to gpfsacl_get_nt_acl() and gpfsacl_fget_nt_acl(),
making both these functions more specific (calling the
corresponding fsp- and non-fsp functions).
gpfsacl_get_nt_acl_common(). is removed.
Michael
(This used to be commit d6043c1066322d2c567aedc5eae1a9d46c8fc396)
Diffstat (limited to 'source3/modules')
-rw-r--r-- | source3/modules/vfs_gpfs.c | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 418a81ffb4..e7331bef29 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -226,8 +226,9 @@ static int gpfs_get_nfs4_acl(const char *fname, SMB4ACL_T **ppacl) return 0; } -static NTSTATUS gpfsacl_get_nt_acl_common(files_struct *fsp, - uint32 security_info, SEC_DESC **ppdesc) +static NTSTATUS gpfsacl_fget_nt_acl(vfs_handle_struct *handle, + files_struct *fsp, int fd, uint32 security_info, + SEC_DESC **ppdesc) { SMB4ACL_T *pacl = NULL; int result; @@ -242,23 +243,31 @@ static NTSTATUS gpfsacl_get_nt_acl_common(files_struct *fsp, DEBUG(10, ("retrying with posix acl...\n")); return posix_fget_nt_acl(fsp, security_info, ppdesc); } - + /* GPFS ACL was not read, something wrong happened, error code is set in errno */ return map_nt_error_from_unix(errno); } -NTSTATUS gpfsacl_fget_nt_acl(vfs_handle_struct *handle, - files_struct *fsp, int fd, uint32 security_info, - SEC_DESC **ppdesc) -{ - return gpfsacl_get_nt_acl_common(fsp, security_info, ppdesc); -} - -NTSTATUS gpfsacl_get_nt_acl(vfs_handle_struct *handle, +static NTSTATUS gpfsacl_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, SEC_DESC **ppdesc) { - return gpfsacl_get_nt_acl_common(fsp, security_info, ppdesc); + SMB4ACL_T *pacl = NULL; + int result; + + *ppdesc = NULL; + result = gpfs_get_nfs4_acl(fsp->fsp_name, &pacl); + + if (result == 0) + return smb_get_nt_acl_nfs4(handle->conn, name, security_info, ppdesc, pacl); + + if (result > 0) { + DEBUG(10, ("retrying with posix acl...\n")); + return posix_get_nt_acl(handle->conn, name, security_info, ppdesc); + } + + /* GPFS ACL was not read, something wrong happened, error code is set in errno */ + return map_nt_error_from_unix(errno); } static bool gpfsacl_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl) |