From aca40f29d5aa96c980fbe010e91be4c0dc608f5f Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Mon, 3 Dec 2007 18:31:03 +0100 Subject: [PATCH] Prepare the aix2 acl module for the api change in get_nt_acl(). This makes both of aixjfs2_[f]get_nt_acl() more specific, eliminating the need for aixjfs2_get_nt_acl_common(). Michael (This used to be commit 36e2a814ba50feefa34c76353c0f5dec1d7cfff4) --- source3/modules/vfs_aixacl2.c | 32 +++++++++++++++++++++----------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/source3/modules/vfs_aixacl2.c b/source3/modules/vfs_aixacl2.c index 289f4af9e6b..d28efa55c65 100644 --- a/source3/modules/vfs_aixacl2.c +++ b/source3/modules/vfs_aixacl2.c @@ -158,8 +158,9 @@ static bool aixjfs2_get_nfs4_acl(const char *name, return True; } -static NTSTATUS aixjfs2_get_nt_acl_common(files_struct *fsp, - uint32 security_info, SEC_DESC **ppdesc) +static NTSTATUS aixjfs2_fget_nt_acl(vfs_handle_struct *handle, + files_struct *fsp, int fd, uint32 security_info, + SEC_DESC **ppdesc) { SMB4ACL_T *pacl = NULL; bool result; @@ -178,18 +179,27 @@ static NTSTATUS aixjfs2_get_nt_acl_common(files_struct *fsp, return smb_fget_nt_acl_nfs4(fsp, security_info, ppdesc, pacl); } -NTSTATUS aixjfs2_fget_nt_acl(vfs_handle_struct *handle, - files_struct *fsp, int fd, uint32 security_info, - SEC_DESC **ppdesc) -{ - return aixjfs2_get_nt_acl_common(fsp, security_info, ppdesc); -} - -NTSTATUS aixjfs2_get_nt_acl(vfs_handle_struct *handle, +static NTSTATUS aixjfs2_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp, const char *name, uint32 security_info, SEC_DESC **ppdesc) { - return aixjfs2_get_nt_acl_common(fsp, security_info, ppdesc); + SMB4ACL_T *pacl = NULL; + bool result; + bool retryPosix = False; + + *ppdesc = NULL; + result = aixjfs2_get_nfs4_acl(name, &pacl, &retryPosix); + if (retryPosix) + { + DEBUG(10, ("retrying with posix acl...\n")); + return posix_get_nt_acl(handle->conn, name security_info, + ppdesc); + } + if (result==False) + return NT_STATUS_ACCESS_DENIED; + + return smb_get_nt_acl_nfs4(handle->conn, name, security_info, ppdesc, + pacl); } static SMB_ACL_T aixjfs2_get_posix_acl(const char *path, acl_type_t type) -- 2.34.1