s3-includes: only include system/filesys.h when needed.
[samba.git] / source3 / modules / vfs_fake_perms.c
index 2740b612caa5b444f686f30a296c2835ecd56e3d..344b15f95da1839c7ea8d2429eec4e4337a7f242 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include "includes.h"
+#include "system/filesys.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
@@ -38,8 +39,8 @@ static int fake_perms_stat(vfs_handle_struct *handle,
                } else {
                        smb_fname->st.st_ex_mode = S_IRWXU;
                }
-               smb_fname->st.st_ex_uid = handle->conn->server_info->utok.uid;
-               smb_fname->st.st_ex_gid = handle->conn->server_info->utok.gid;
+               smb_fname->st.st_ex_uid = handle->conn->session_info->utok.uid;
+               smb_fname->st.st_ex_gid = handle->conn->session_info->utok.gid;
        }
 
        return ret;
@@ -56,23 +57,20 @@ static int fake_perms_fstat(vfs_handle_struct *handle, files_struct *fsp, SMB_ST
                } else {
                        sbuf->st_ex_mode = S_IRWXU;
                }
-               sbuf->st_ex_uid = handle->conn->server_info->utok.uid;
-               sbuf->st_ex_gid = handle->conn->server_info->utok.gid;
+               sbuf->st_ex_uid = handle->conn->session_info->utok.uid;
+               sbuf->st_ex_gid = handle->conn->session_info->utok.gid;
        }
        return ret;
 }
 
-/* VFS operations structure */
-
-static vfs_op_tuple fake_perms_ops[] = {       
-       {SMB_VFS_OP(fake_perms_stat),   SMB_VFS_OP_STAT,        SMB_VFS_LAYER_TRANSPARENT},
-       {SMB_VFS_OP(fake_perms_fstat),  SMB_VFS_OP_FSTAT,       SMB_VFS_LAYER_TRANSPARENT},
-
-       {SMB_VFS_OP(NULL),              SMB_VFS_OP_NOOP,        SMB_VFS_LAYER_NOOP}
+static struct vfs_fn_pointers vfs_fake_perms_fns = {
+       .stat = fake_perms_stat,
+       .fstat = fake_perms_fstat
 };
 
 NTSTATUS vfs_fake_perms_init(void);
 NTSTATUS vfs_fake_perms_init(void)
 {
-       return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "fake_perms", fake_perms_ops);
+       return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "fake_perms",
+                               &vfs_fake_perms_fns);
 }