vfs: Make function pointer names consistent. They all end in _fn
[kai/samba.git] / source3 / modules / vfs_aixacl2.c
index a078b9f9f62c9801cb6a4a5059e4f8b004c9fdf4..3f13a6fa87f35678da837e15ef494b2e70f8acc2 100644 (file)
@@ -18,6 +18,8 @@
  */
 
 #include "includes.h"
+#include "system/filesys.h"
+#include "smbd/smbd.h"
 #include "nfs4_acls.h"
 
 #undef DBGC_CLASS
@@ -25,8 +27,6 @@
 
 #define AIXACL2_MODULE_NAME "aixacl2"
 
-extern int try_chown(connection_struct *conn, const char *fname, uid_t uid, gid_t gid);
-
 extern SMB_ACL_T aixacl_to_smbacl( struct acl *file_acl);
 extern struct acl *aixacl_smb_to_aixacl(SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl);
 
@@ -157,14 +157,15 @@ static bool aixjfs2_get_nfs4_acl(const char *name,
 
 static NTSTATUS aixjfs2_fget_nt_acl(vfs_handle_struct *handle,
        files_struct *fsp, uint32 security_info,
-       SEC_DESC **ppdesc)
+       struct security_descriptor **ppdesc)
 {
        SMB4ACL_T *pacl = NULL;
        bool    result;
        bool    retryPosix = False;
 
        *ppdesc = NULL;
-       result = aixjfs2_get_nfs4_acl(fsp->fsp_name, &pacl, &retryPosix);
+       result = aixjfs2_get_nfs4_acl(fsp->fsp_name->base_name, &pacl,
+                                     &retryPosix);
        if (retryPosix)
        {
                DEBUG(10, ("retrying with posix acl...\n"));
@@ -178,7 +179,7 @@ static NTSTATUS aixjfs2_fget_nt_acl(vfs_handle_struct *handle,
 
 static NTSTATUS aixjfs2_get_nt_acl(vfs_handle_struct *handle,
        const char *name,
-       uint32 security_info, SEC_DESC **ppdesc)
+       uint32 security_info, struct security_descriptor **ppdesc)
 {
        SMB4ACL_T *pacl = NULL;
        bool    result;
@@ -260,7 +261,7 @@ SMB_ACL_T aixjfs2_sys_acl_get_fd(vfs_handle_struct *handle,
         acl_type_t aixjfs2_type;
         aixjfs2_type.u64 = ACL_AIXC;
 
-       return aixjfs2_get_posix_acl(fsp->fsp_name, aixjfs2_type);
+       return aixjfs2_get_posix_acl(fsp->fsp_name->base_name, aixjfs2_type);
 }
 
 /*
@@ -306,7 +307,7 @@ static bool aixjfs2_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl)
        int     rc;
        acl_type_t      acltype;
 
-       DEBUG(10, ("jfs2_process_smbacl invoked on %s\n", fsp->fsp_name));
+       DEBUG(10, ("jfs2_process_smbacl invoked on %s\n", fsp_str_dbg(fsp)));
 
        /* no need to be freed which is alloced with mem_ctx */
        mem_ctx = talloc_tos();
@@ -355,7 +356,7 @@ static bool aixjfs2_process_smbacl(files_struct *fsp, SMB4ACL_T *smbacl)
 
        /* won't set S_ISUID - the only one JFS2/NFS4 accepts */
        rc = aclx_put(
-               fsp->fsp_name,
+               fsp->fsp_name->base_name,
                SET_ACL, /* set only the ACL, not mode bits */
                acltype, /* not a pointer !!! */
                jfs2acl,
@@ -371,7 +372,7 @@ 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 SEC_DESC *psd)
+static NTSTATUS aixjfs2_set_nt_acl_common(files_struct *fsp, uint32 security_info_sent, const struct security_descriptor *psd)
 {
        acl_type_t      acl_type_info;
        NTSTATUS        result = NT_STATUS_ACCESS_DENIED;
@@ -395,7 +396,7 @@ static NTSTATUS aixjfs2_set_nt_acl_common(files_struct *fsp, uint32 security_inf
        return result;
 }
 
-NTSTATUS aixjfs2_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32 security_info_sent, const SEC_DESC *psd)
+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);
 }
@@ -446,9 +447,10 @@ int aixjfs2_sys_acl_set_fd(vfs_handle_struct *handle,
        acl_type_t      acl_type_info;
        int     rc;
 
-       DEBUG(10, ("aixjfs2_sys_acl_set_fd invoked for %s", fsp->fsp_name));
+       DEBUG(10, ("aixjfs2_sys_acl_set_fd invoked for %s", fsp_str_dbg(fsp)));
 
-       rc = aixjfs2_query_acl_support(fsp->fsp_name, ACL_AIXC, &acl_type_info);
+       rc = aixjfs2_query_acl_support(fsp->fsp_name->base_name, ACL_AIXC,
+                                      &acl_type_info);
        if (rc) {
                DEBUG(8, ("jfs2_set_nt_acl: AIXC support not found\n"));
                return -1;
@@ -468,7 +470,7 @@ int aixjfs2_sys_acl_set_fd(vfs_handle_struct *handle,
        );
        if (rc) {
                DEBUG(2, ("aclx_fput failed with %s for %s\n",
-                       strerror(errno), fsp->fsp_name));
+                       strerror(errno), fsp_str_dbg(fsp)));
                return -1;
        }
 
@@ -484,51 +486,20 @@ int aixjfs2_sys_acl_delete_def_file(vfs_handle_struct *handle,
        return 0;
 }
 
-
-/* VFS operations structure */
-
-static vfs_op_tuple aixjfs2_ops[] =
-{
-       {SMB_VFS_OP(aixjfs2_fget_nt_acl),
-       SMB_VFS_OP_FGET_NT_ACL,
-       SMB_VFS_LAYER_TRANSPARENT},
-
-       {SMB_VFS_OP(aixjfs2_get_nt_acl),
-       SMB_VFS_OP_GET_NT_ACL,
-       SMB_VFS_LAYER_TRANSPARENT},
-
-       {SMB_VFS_OP(aixjfs2_fset_nt_acl),
-       SMB_VFS_OP_FSET_NT_ACL,
-       SMB_VFS_LAYER_TRANSPARENT},
-
-       {SMB_VFS_OP(aixjfs2_sys_acl_get_file),
-       SMB_VFS_OP_SYS_ACL_GET_FILE,
-       SMB_VFS_LAYER_TRANSPARENT},
-
-       {SMB_VFS_OP(aixjfs2_sys_acl_get_fd),
-       SMB_VFS_OP_SYS_ACL_GET_FD,
-       SMB_VFS_LAYER_TRANSPARENT},
-
-       {SMB_VFS_OP(aixjfs2_sys_acl_set_file),
-       SMB_VFS_OP_SYS_ACL_SET_FILE,
-       SMB_VFS_LAYER_TRANSPARENT},
-
-       {SMB_VFS_OP(aixjfs2_sys_acl_set_fd),
-       SMB_VFS_OP_SYS_ACL_SET_FD,
-       SMB_VFS_LAYER_TRANSPARENT},
-
-       {SMB_VFS_OP(aixjfs2_sys_acl_delete_def_file),
-       SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE,
-       SMB_VFS_LAYER_TRANSPARENT},
-
-       {SMB_VFS_OP(NULL),
-       SMB_VFS_OP_NOOP,
-       SMB_VFS_LAYER_NOOP}
+static struct vfs_fn_pointers vfs_aixacl2_fns = {
+       .fget_nt_acl_fn = aixjfs2_fget_nt_acl,
+       .get_nt_acl_fn = aixjfs2_get_nt_acl,
+       .fset_nt_acl_fn = aixjfs2_fset_nt_acl,
+       .sys_acl_get_file_fn = aixjfs2_sys_acl_get_file,
+       .sys_acl_get_fd_fn = aixjfs2_sys_acl_get_fd,
+       .sys_acl_set_file_fn = aixjfs2_sys_acl_set_file,
+       .sys_acl_set_fd_fn = aixjfs2_sys_acl_set_fd,
+       .sys_acl_delete_def_file_fn = aixjfs2_sys_acl_delete_def_file
 };
 
 NTSTATUS vfs_aixacl2_init(void);
 NTSTATUS vfs_aixacl2_init(void)
 {
         return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, AIXACL2_MODULE_NAME,
-                                aixjfs2_ops);
+                               &vfs_aixacl2_fns);
 }