vfs: Add vfs_handle_struct argument to smb_set_nt_acl_nfs4 and the callback
authorAndrew Bartlett <abartlet@samba.org>
Sun, 14 Apr 2013 07:31:42 +0000 (17:31 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 9 May 2013 04:18:20 +0000 (06:18 +0200)
This allows the callback to call xattr based storage functions that need this argument.

Andrew Bartlett

Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/nfs4_acls.c
source3/modules/nfs4_acls.h
source3/modules/vfs_aixacl2.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_zfsacl.c

index 67db6b023c5fb1968d73ab6c28cd4edc3190e375..fa9efc12e9257f1da76091797e9b170ff955d949 100644 (file)
@@ -734,7 +734,7 @@ static SMB4ACL_T *smbacl4_win2nfs4(
        return theacl;
 }
 
-NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp,
+NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
        uint32 security_info_sent,
        const struct security_descriptor *psd,
        set_nfs4acl_native_fn_t set_nfs4_native)
@@ -819,7 +819,7 @@ NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp,
        if (set_acl_as_root) {
                become_root();
        }
-       result = set_nfs4_native(fsp, theacl);
+       result = set_nfs4_native(handle, fsp, theacl);
        saved_errno = errno;
        if (set_acl_as_root) {
                unbecome_root();
index c461229c6c14d337ea33cc9b249025af9926531e..f45039636160cc2b37026bbc200ec5a4ad6c2d10 100644 (file)
@@ -143,9 +143,9 @@ NTSTATUS smb_get_nt_acl_nfs4(connection_struct *conn,
 
 /* Callback function needed to set the native acl
  * when applicable */
-typedef bool (*set_nfs4acl_native_fn_t)(files_struct *, SMB4ACL_T *);
+typedef bool (*set_nfs4acl_native_fn_t)(vfs_handle_struct *handle, files_struct *, SMB4ACL_T *);
 
-NTSTATUS smb_set_nt_acl_nfs4(files_struct *fsp,
+NTSTATUS smb_set_nt_acl_nfs4(vfs_handle_struct *handle, files_struct *fsp,
        uint32 security_info_sent,
        const struct security_descriptor *psd,
        set_nfs4acl_native_fn_t set_nfs4_native);
index 65625d1853eb798553e02cb8b57b47e9a9f71508..aca7a652d6613a64194ab9da5032c801a912056b 100644 (file)
@@ -338,7 +338,7 @@ static int aixjfs2_query_acl_support(
        return 1; /* haven't found that ACL type. */
 }
 
-static bool aixjfs2_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl)
+static bool aixjfs2_process_smbacl(vfs_handle_struct *handle, files_struct *fsp, SMB4ACL_T *smbacl)
 {
        SMB4ACE_T       *smbace;
        TALLOC_CTX      *mem_ctx;
@@ -413,20 +413,21 @@ static bool aixjfs2_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl)
        return True;
 }
 
-static NTSTATUS aixjfs2_set_nt_acl_common(files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd)
+static NTSTATUS aixjfs2_set_nt_acl_common(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd)
 {
        acl_type_t      acl_type_info;
        NTSTATUS        result = NT_STATUS_ACCESS_DENIED;
        int     rc;
 
        rc = aixjfs2_query_acl_support(
+               handle,
                fsp->fsp_name,
                ACL_NFS4,
                &acl_type_info);
 
        if (rc==0)
        {
-               result = smb_set_nt_acl_nfs4(
+               result = smb_set_nt_acl_nfs4(handle,
                        fsp, security_info_sent, psd,
                        aixjfs2_process_smbacl);
        } else if (rc==1) { /* assume POSIX ACL - by default... */
@@ -439,7 +440,7 @@ static NTSTATUS aixjfs2_set_nt_acl_common(files_struct *fsp, uint32 security_inf
 
 NTSTATUS aixjfs2_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd)
 {
-       return aixjfs2_set_nt_acl_common(fsp, security_info_sent, psd);
+       return aixjfs2_set_nt_acl_common(handle, fsp, security_info_sent, psd);
 }
 
 int aixjfs2_sys_acl_set_file(vfs_handle_struct *handle,
index 674e101c5837186b6850ee176c6bdd2fd7e6e461..33a81a026259108ec070375dea1b4c1b8df54a17 100644 (file)
@@ -453,7 +453,7 @@ static NTSTATUS gpfsacl_get_nt_acl(vfs_handle_struct *handle,
        return map_nt_error_from_unix(errno);
 }
 
-static bool gpfsacl_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl)
+static bool gpfsacl_process_smbacl(vfs_handle_struct *handle, files_struct *fsp, SMB4ACL_T *smbacl)
 {
        int ret;
        gpfs_aclLen_t gacl_len;
@@ -549,7 +549,7 @@ static bool gpfsacl_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl)
        return True;
 }
 
-static NTSTATUS gpfsacl_set_nt_acl_internal(files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd)
+static NTSTATUS gpfsacl_set_nt_acl_internal(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd)
 {
        struct gpfs_acl *acl;
        NTSTATUS result = NT_STATUS_ACCESS_DENIED;
@@ -570,7 +570,7 @@ static NTSTATUS gpfsacl_set_nt_acl_internal(files_struct *fsp, uint32 security_i
                        return NT_STATUS_NOT_SUPPORTED;
                }
 
-               result = smb_set_nt_acl_nfs4(
+               result = smb_set_nt_acl_nfs4(handle,
                        fsp, security_info_sent, psd,
                        gpfsacl_process_smbacl);
        } else { /* assume POSIX ACL - by default... */
@@ -593,7 +593,7 @@ static NTSTATUS gpfsacl_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp
                return SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
        }
 
-       return gpfsacl_set_nt_acl_internal(fsp, security_info_sent, psd);
+       return gpfsacl_set_nt_acl_internal(handle, fsp, security_info_sent, psd);
 }
 
 static SMB_ACL_T gpfs2smb_acl(const struct gpfs_acl *pacl, TALLOC_CTX *mem_ctx)
index 6934ad6cf903eae35dacc81978b23b7edbb712ba..91e31e9c4e00f10d3428d0bde1c7c484662b9131 100644 (file)
@@ -106,7 +106,7 @@ static NTSTATUS zfs_get_nt_acl_common(const char *name,
 }
 
 /* call-back function processing the NT acl -> ZFS acl using NFSv4 conv. */
-static bool zfs_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl)
+static bool zfs_process_smbacl(vfs_handle_struct *handle, files_struct *fsp, SMB4ACL_T *smbacl)
 {
        int naces = smb_get_naces(smbacl), i;
        ace_t *acebuf;
@@ -187,8 +187,8 @@ static NTSTATUS zfs_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                           uint32 security_info_sent,
                           const struct security_descriptor *psd)
 {
-       return smb_set_nt_acl_nfs4(fsp, security_info_sent, psd,
-                       zfs_process_smbacl);
+        return smb_set_nt_acl_nfs4(handle, fsp, security_info_sent, psd,
+                                  zfs_process_smbacl);
 }
 
 static NTSTATUS zfsacl_fget_nt_acl(struct vfs_handle_struct *handle,