s3: Modify SMB_VFS_FILE_ID_CREATE to take a stat struct
[jra/samba/.git] / source3 / modules / vfs_full_audit.c
index bdbd84ab4fd4e1d178bbb36eb95c010c5d3cfdce..3c159f10eb1ec1369873fe493134ad155e8a382d 100644 (file)
@@ -59,8 +59,6 @@
 
 #include "includes.h"
 
-extern userdom_struct current_user_info;
-
 static int vfs_full_audit_debug_level = DBGC_VFS;
 
 struct vfs_full_audit_private_data {
@@ -76,10 +74,10 @@ struct vfs_full_audit_private_data {
 static int smb_full_audit_connect(vfs_handle_struct *handle,
                         const char *svc, const char *user);
 static void smb_full_audit_disconnect(vfs_handle_struct *handle);
-static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle,
+static uint64_t smb_full_audit_disk_free(vfs_handle_struct *handle,
                                    const char *path,
-                                   bool small_query, SMB_BIG_UINT *bsize, 
-                                   SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
+                                   bool small_query, uint64_t *bsize, 
+                                   uint64_t *dfree, uint64_t *dsize);
 static int smb_full_audit_get_quota(struct vfs_handle_struct *handle,
                           enum SMB_QUOTA_TYPE qtype, unid_t id,
                           SMB_DISK_QUOTA *qt);
@@ -92,11 +90,12 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
 static int smb_full_audit_statvfs(struct vfs_handle_struct *handle,
                                const char *path,
                                struct vfs_statvfs_struct *statbuf);
-
+static int smb_full_audit_fs_capabilities(struct vfs_handle_struct *handle);
 static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle,
                          const char *fname, const char *mask, uint32 attr);
 static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle,
-                                   SMB_STRUCT_DIR *dirp);
+                                   SMB_STRUCT_DIR *dirp,
+                                   SMB_STRUCT_STAT *sbuf);
 static void smb_full_audit_seekdir(vfs_handle_struct *handle,
                        SMB_STRUCT_DIR *dirp, long offset);
 static long smb_full_audit_telldir(vfs_handle_struct *handle,
@@ -109,46 +108,67 @@ static int smb_full_audit_rmdir(vfs_handle_struct *handle,
                       const char *path);
 static int smb_full_audit_closedir(vfs_handle_struct *handle,
                          SMB_STRUCT_DIR *dirp);
+static void smb_full_audit_init_search_op(vfs_handle_struct *handle,
+                       SMB_STRUCT_DIR *dirp);
 static int smb_full_audit_open(vfs_handle_struct *handle,
                      const char *fname, files_struct *fsp, int flags, mode_t mode);
-static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd);
+static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
+                                     struct smb_request *req,
+                                     uint16_t root_dir_fid,
+                                     const char *fname,
+                                     uint32_t create_file_flags,
+                                     uint32_t access_mask,
+                                     uint32_t share_access,
+                                     uint32_t create_disposition,
+                                     uint32_t create_options,
+                                     uint32_t file_attributes,
+                                     uint32_t oplock_request,
+                                     uint64_t allocation_size,
+                                     struct security_descriptor *sd,
+                                     struct ea_list *ea_list,
+                                     files_struct **result,
+                                     int *pinfo,
+                                     SMB_STRUCT_STAT *psbuf);
+static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp);
 static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
-                         int fd, void *data, size_t n);
+                         void *data, size_t n);
 static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp,
-                          int fd, void *data, size_t n, SMB_OFF_T offset);
+                          void *data, size_t n, SMB_OFF_T offset);
 static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp,
-                          int fd, const void *data, size_t n);
+                          const void *data, size_t n);
 static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp,
-                           int fd, const void *data, size_t n,
+                           const void *data, size_t n,
                            SMB_OFF_T offset);
 static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp,
-                            int filedes, SMB_OFF_T offset, int whence);
+                            SMB_OFF_T offset, int whence);
 static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd,
-                             files_struct *fsp, int fromfd,
+                             files_struct *fromfsp,
                              const DATA_BLOB *hdr, SMB_OFF_T offset,
                              size_t n);
 static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd,
-                             files_struct *fsp, int tofd,
+                             files_struct *tofsp,
                              SMB_OFF_T offset,
                              size_t n);
 static int smb_full_audit_rename(vfs_handle_struct *handle,
                        const char *oldname, const char *newname);
-static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd);
+static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp);
 static int smb_full_audit_stat(vfs_handle_struct *handle,
                      const char *fname, SMB_STRUCT_STAT *sbuf);
-static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp,
                       SMB_STRUCT_STAT *sbuf);
 static int smb_full_audit_lstat(vfs_handle_struct *handle,
                       const char *path, SMB_STRUCT_STAT *sbuf);
+static int smb_full_audit_get_alloc_size(vfs_handle_struct *handle,
+                      files_struct *fsp, const SMB_STRUCT_STAT *sbuf);
 static int smb_full_audit_unlink(vfs_handle_struct *handle,
                        const char *path);
 static int smb_full_audit_chmod(vfs_handle_struct *handle,
                       const char *path, mode_t mode);
-static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp,
                        mode_t mode);
 static int smb_full_audit_chown(vfs_handle_struct *handle,
                       const char *path, uid_t uid, gid_t gid);
-static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp,
                        uid_t uid, gid_t gid);
 static int smb_full_audit_lchown(vfs_handle_struct *handle,
                       const char *path, uid_t uid, gid_t gid);
@@ -157,17 +177,17 @@ static int smb_full_audit_chdir(vfs_handle_struct *handle,
 static char *smb_full_audit_getwd(vfs_handle_struct *handle,
                         char *path);
 static int smb_full_audit_ntimes(vfs_handle_struct *handle,
-                      const char *path, const struct timespec ts[2]);
+                      const char *path, struct smb_file_time *ft);
 static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
-                          int fd, SMB_OFF_T len);
-static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd,
+                          SMB_OFF_T len);
+static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
                       int op, SMB_OFF_T offset, SMB_OFF_T count, int type);
 static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
-                                      struct files_struct *fsp, int fd,
+                                      struct files_struct *fsp,
                                       uint32 share_mode);
 static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
-                                       int fd, int leasetype);
-static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd,
+                                       int leasetype);
+static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp,
                       SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid);
 static int smb_full_audit_symlink(vfs_handle_struct *handle,
                         const char *oldpath, const char *newpath);
@@ -189,23 +209,44 @@ static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle,
 static int smb_full_audit_chflags(vfs_handle_struct *handle,
                            const char *path, unsigned int flags);
 static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle,
-                                                   SMB_DEV_T dev, SMB_INO_T inode);
+                                                   const SMB_STRUCT_STAT *sbuf);
+static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle,
+                                         struct files_struct *fsp,
+                                         const char *fname,
+                                         TALLOC_CTX *mem_ctx,
+                                         unsigned int *pnum_streams,
+                                         struct stream_struct **pstreams);
+static int smb_full_audit_get_real_filename(struct vfs_handle_struct *handle,
+                                           const char *path,
+                                           const char *name,
+                                           TALLOC_CTX *mem_ctx,
+                                           char **found_name);
+static NTSTATUS smb_full_audit_brl_lock_windows(struct vfs_handle_struct *handle,
+                                               struct byte_range_lock *br_lck,
+                                               struct lock_struct *plock,
+                                               bool blocking_lock,
+                                               struct blocking_lock_record *blr);
+static bool smb_full_audit_brl_unlock_windows(struct vfs_handle_struct *handle,
+                                             struct messaging_context *msg_ctx,
+                                             struct byte_range_lock *br_lck,
+                                             const struct lock_struct *plock);
+static bool smb_full_audit_brl_cancel_windows(struct vfs_handle_struct *handle,
+                                             struct byte_range_lock *br_lck,
+                                             struct lock_struct *plock,
+                                             struct blocking_lock_record *blr);
 static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                                uint32 security_info,
                                SEC_DESC **ppdesc);
-static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
+static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle,
                               const char *name, uint32 security_info,
                               SEC_DESC **ppdesc);
 static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                              uint32 security_info_sent,
-                             SEC_DESC *psd);
-static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                            const char *name, uint32 security_info_sent,
-                            SEC_DESC *psd);
+                             const SEC_DESC *psd);
 static int smb_full_audit_chmod_acl(vfs_handle_struct *handle,
                           const char *path, mode_t mode);
 static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
-                           int fd, mode_t mode);
+                                    mode_t mode);
 static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle,
                                   SMB_ACL_T theacl, int entry_id,
                                   SMB_ACL_ENTRY_T *entry_p);
@@ -221,8 +262,7 @@ static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle,
                                        const char *path_p,
                                        SMB_ACL_TYPE_T type);
 static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle,
-                                     files_struct *fsp,
-                                     int fd);
+                                     files_struct *fsp);
 static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle,
                                     SMB_ACL_PERMSET_T permset);
 static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle,
@@ -251,7 +291,7 @@ static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
                                  const char *name, SMB_ACL_TYPE_T acltype,
                                  SMB_ACL_T theacl);
 static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                               int fd, SMB_ACL_T theacl);
+                               SMB_ACL_T theacl);
 static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle,
                                         const char *path);
 static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle,
@@ -271,14 +311,14 @@ static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle,
                               const char *path, const char *name,
                               void *value, size_t size);
 static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle,
-                              struct files_struct *fsp, int fd,
+                              struct files_struct *fsp,
                               const char *name, void *value, size_t size);
 static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle,
                               const char *path, char *list, size_t size);
 static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle,
                                const char *path, char *list, size_t size);
 static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle,
-                               struct files_struct *fsp, int fd, char *list,
+                               struct files_struct *fsp, char *list,
                                size_t size);
 static int smb_full_audit_removexattr(struct vfs_handle_struct *handle,
                             const char *path,
@@ -287,7 +327,7 @@ static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle,
                              const char *path,
                              const char *name);
 static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle,
-                             struct files_struct *fsp, int fd,
+                             struct files_struct *fsp,
                              const char *name);
 static int smb_full_audit_setxattr(struct vfs_handle_struct *handle,
                          const char *path,
@@ -298,21 +338,23 @@ static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle,
                           const char *name, const void *value, size_t size,
                           int flags);
 static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle,
-                          struct files_struct *fsp, int fd, const char *name,
+                          struct files_struct *fsp, const char *name,
                           const void *value, size_t size, int flags);
 
 static int smb_full_audit_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
 static int smb_full_audit_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
 static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
-static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb);
+static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
 static int smb_full_audit_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb);
 static int smb_full_audit_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb);
 static int smb_full_audit_aio_suspend(struct vfs_handle_struct *handle, struct files_struct *fsp, const SMB_STRUCT_AIOCB * const aiocb[], int n, const struct timespec *ts);
+static bool smb_full_audit_aio_force(struct vfs_handle_struct *handle,
+                                    struct files_struct *fsp);
 
 /* VFS operations */
 
 static vfs_op_tuple audit_op_tuples[] = {
-    
+
        /* Disk operations */
 
        {SMB_VFS_OP(smb_full_audit_connect),    SMB_VFS_OP_CONNECT,
@@ -329,6 +371,8 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_statvfs),    SMB_VFS_OP_STATVFS,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_fs_capabilities), SMB_VFS_OP_FS_CAPABILITIES,
+        SMB_VFS_LAYER_LOGGER},
 
        /* Directory operations */
 
@@ -348,11 +392,15 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_closedir),   SMB_VFS_OP_CLOSEDIR,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_init_search_op), SMB_VFS_OP_INIT_SEARCH_OP,
+        SMB_VFS_LAYER_LOGGER},
 
        /* File operations */
 
        {SMB_VFS_OP(smb_full_audit_open),       SMB_VFS_OP_OPEN,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_create_file),SMB_VFS_OP_CREATE_FILE,
+        SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_close),      SMB_VFS_OP_CLOSE,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_read),       SMB_VFS_OP_READ,
@@ -379,6 +427,8 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_lstat),      SMB_VFS_OP_LSTAT,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_get_alloc_size),     SMB_VFS_OP_GET_ALLOC_SIZE,
+        SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_unlink),     SMB_VFS_OP_UNLINK,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_chmod),      SMB_VFS_OP_CHMOD,
@@ -423,6 +473,16 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_file_id_create),     SMB_VFS_OP_FILE_ID_CREATE,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_streaminfo), SMB_VFS_OP_STREAMINFO,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_get_real_filename), SMB_VFS_OP_GET_REAL_FILENAME,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_brl_lock_windows), SMB_VFS_OP_BRL_LOCK_WINDOWS,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_brl_unlock_windows), SMB_VFS_OP_BRL_UNLOCK_WINDOWS,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_brl_cancel_windows), SMB_VFS_OP_BRL_CANCEL_WINDOWS,
+        SMB_VFS_LAYER_LOGGER},
 
        /* NT ACL operations. */
 
@@ -432,8 +492,6 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_fset_nt_acl),        SMB_VFS_OP_FSET_NT_ACL,
         SMB_VFS_LAYER_LOGGER},
-       {SMB_VFS_OP(smb_full_audit_set_nt_acl), SMB_VFS_OP_SET_NT_ACL,
-        SMB_VFS_LAYER_LOGGER},
 
        /* POSIX ACL operations. */
 
@@ -451,7 +509,7 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_sys_acl_get_file),   SMB_VFS_OP_SYS_ACL_GET_FILE,
         SMB_VFS_LAYER_LOGGER},
-       {SMB_VFS_OP(smb_full_audit_sys_acl_get_fd),     SMB_VFS_OP_SYS_ACL_GET_FD,
+{SMB_VFS_OP(smb_full_audit_sys_acl_get_fd),    SMB_VFS_OP_SYS_ACL_GET_FD,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_sys_acl_clear_perms),        SMB_VFS_OP_SYS_ACL_CLEAR_PERMS,
         SMB_VFS_LAYER_LOGGER},
@@ -485,7 +543,7 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_sys_acl_free_qualifier),     SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER,
         SMB_VFS_LAYER_LOGGER},
-       
+
        /* EA operations. */
 
        {SMB_VFS_OP(smb_full_audit_getxattr),   SMB_VFS_OP_GETXATTR,
@@ -512,7 +570,7 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_fsetxattr),  SMB_VFS_OP_FSETXATTR,
         SMB_VFS_LAYER_LOGGER},
-       
+
        {SMB_VFS_OP(smb_full_audit_aio_read),   SMB_VFS_OP_AIO_READ,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_aio_write),  SMB_VFS_OP_AIO_WRITE,
@@ -527,9 +585,11 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_aio_suspend),SMB_VFS_OP_AIO_SUSPEND,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_aio_force),SMB_VFS_OP_AIO_FORCE,
+        SMB_VFS_LAYER_LOGGER},
 
        /* Finish VFS operations definition */
-       
+
        {SMB_VFS_OP(NULL),              SMB_VFS_OP_NOOP,
         SMB_VFS_LAYER_NOOP}
 };
@@ -547,6 +607,7 @@ static struct {
        { SMB_VFS_OP_SET_QUOTA, "set_quota" },
        { SMB_VFS_OP_GET_SHADOW_COPY_DATA,      "get_shadow_copy_data" },
        { SMB_VFS_OP_STATVFS,   "statvfs" },
+       { SMB_VFS_OP_FS_CAPABILITIES,   "fs_capabilities" },
        { SMB_VFS_OP_OPENDIR,   "opendir" },
        { SMB_VFS_OP_READDIR,   "readdir" },
        { SMB_VFS_OP_SEEKDIR,   "seekdir" },
@@ -555,7 +616,9 @@ static struct {
        { SMB_VFS_OP_MKDIR,     "mkdir" },
        { SMB_VFS_OP_RMDIR,     "rmdir" },
        { SMB_VFS_OP_CLOSEDIR,  "closedir" },
+       { SMB_VFS_OP_INIT_SEARCH_OP, "init_search_op" },
        { SMB_VFS_OP_OPEN,      "open" },
+       { SMB_VFS_OP_CREATE_FILE, "create_file" },
        { SMB_VFS_OP_CLOSE,     "close" },
        { SMB_VFS_OP_READ,      "read" },
        { SMB_VFS_OP_PREAD,     "pread" },
@@ -563,11 +626,13 @@ static struct {
        { SMB_VFS_OP_PWRITE,    "pwrite" },
        { SMB_VFS_OP_LSEEK,     "lseek" },
        { SMB_VFS_OP_SENDFILE,  "sendfile" },
+       { SMB_VFS_OP_RECVFILE,  "recvfile" },
        { SMB_VFS_OP_RENAME,    "rename" },
        { SMB_VFS_OP_FSYNC,     "fsync" },
        { SMB_VFS_OP_STAT,      "stat" },
        { SMB_VFS_OP_FSTAT,     "fstat" },
        { SMB_VFS_OP_LSTAT,     "lstat" },
+       { SMB_VFS_OP_GET_ALLOC_SIZE,    "get_alloc_size" },
        { SMB_VFS_OP_UNLINK,    "unlink" },
        { SMB_VFS_OP_CHMOD,     "chmod" },
        { SMB_VFS_OP_FCHMOD,    "fchmod" },
@@ -590,10 +655,14 @@ static struct {
        { SMB_VFS_OP_NOTIFY_WATCH, "notify_watch" },
        { SMB_VFS_OP_CHFLAGS,   "chflags" },
        { SMB_VFS_OP_FILE_ID_CREATE,    "file_id_create" },
+       { SMB_VFS_OP_STREAMINFO,        "streaminfo" },
+       { SMB_VFS_OP_GET_REAL_FILENAME, "get_real_filename" },
+       { SMB_VFS_OP_BRL_LOCK_WINDOWS,  "brl_lock_windows" },
+       { SMB_VFS_OP_BRL_UNLOCK_WINDOWS, "brl_unlock_windows" },
+       { SMB_VFS_OP_BRL_CANCEL_WINDOWS, "brl_cancel_windows" },
        { SMB_VFS_OP_FGET_NT_ACL,       "fget_nt_acl" },
        { SMB_VFS_OP_GET_NT_ACL,        "get_nt_acl" },
        { SMB_VFS_OP_FSET_NT_ACL,       "fset_nt_acl" },
-       { SMB_VFS_OP_SET_NT_ACL,        "set_nt_acl" },
        { SMB_VFS_OP_CHMOD_ACL, "chmod_acl" },
        { SMB_VFS_OP_FCHMOD_ACL,        "fchmod_acl" },
        { SMB_VFS_OP_SYS_ACL_GET_ENTRY, "sys_acl_get_entry" },
@@ -637,8 +706,11 @@ static struct {
        { SMB_VFS_OP_AIO_ERROR, "aio_error" },
        { SMB_VFS_OP_AIO_FSYNC, "aio_fsync" },
        { SMB_VFS_OP_AIO_SUSPEND,"aio_suspend" },
+       { SMB_VFS_OP_AIO_FORCE, "aio_force" },
+       { SMB_VFS_OP_IS_OFFLINE, "aio_is_offline" },
+       { SMB_VFS_OP_SET_OFFLINE, "aio_set_offline" },
        { SMB_VFS_OP_LAST, NULL }
-};     
+};
 
 static int audit_syslog_facility(vfs_handle_struct *handle)
 {
@@ -676,7 +748,11 @@ static int audit_syslog_priority(vfs_handle_struct *handle)
 
        int priority;
 
-       priority = lp_parm_enum(SNUM(handle->conn), "full_audit", "priority", enum_log_priorities, LOG_NOTICE);
+       priority = lp_parm_enum(SNUM(handle->conn), "full_audit", "priority",
+                               enum_log_priorities, LOG_NOTICE);
+       if (priority == -1) {
+               priority = LOG_WARNING;
+       }
 
        return priority;
 }
@@ -684,6 +760,7 @@ static int audit_syslog_priority(vfs_handle_struct *handle)
 static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
 {
        char *prefix = NULL;
+       char *result;
 
        prefix = talloc_strdup(ctx,
                        lp_parm_const_string(SNUM(conn), "full_audit",
@@ -691,12 +768,16 @@ static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
        if (!prefix) {
                return NULL;
        }
-       return talloc_sub_advanced(ctx,
-                       lp_servicename(SNUM(conn)), conn->user,
-                       conn->connectpath, conn->gid,
-                       get_current_username(),
-                       current_user_info.domain,
+       result = talloc_sub_advanced(ctx,
+                       lp_servicename(SNUM(conn)),
+                       conn->server_info->unix_name,
+                       conn->connectpath,
+                       conn->server_info->utok.gid,
+                       conn->server_info->sanitized_username,
+                       pdb_get_domain(conn->server_info->sam_account),
                        prefix);
+       TALLOC_FREE(prefix);
+       return result;
 }
 
 static bool log_success(vfs_handle_struct *handle, vfs_op_type op)
@@ -810,14 +891,14 @@ static void do_log(vfs_op_type op, bool success, vfs_handle_struct *handle,
                fstr_sprintf(err_msg, "fail (%s)", strerror(errno));
 
        va_start(ap, format);
-       op_msg = talloc_vasprintf(NULL, format, ap);
+       op_msg = talloc_vasprintf(talloc_tos(), format, ap);
        va_end(ap);
 
        if (!op_msg) {
                return;
        }
 
-       audit_pre = audit_prefix(NULL, handle->conn);
+       audit_pre = audit_prefix(talloc_tos(), handle->conn);
        syslog(audit_syslog_priority(handle), "%s|%s|%s|%s\n",
                audit_pre ? audit_pre : "",
                audit_opname(op), err_msg, op_msg);
@@ -899,12 +980,12 @@ static void smb_full_audit_disconnect(vfs_handle_struct *handle)
        return;
 }
 
-static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle,
+static uint64_t smb_full_audit_disk_free(vfs_handle_struct *handle,
                                    const char *path,
-                                   bool small_query, SMB_BIG_UINT *bsize, 
-                                   SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
+                                   bool small_query, uint64_t *bsize, 
+                                   uint64_t *dfree, uint64_t *dsize)
 {
-       SMB_BIG_UINT result;
+       uint64_t result;
 
        result = SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
                                        dfree, dsize);
@@ -969,6 +1050,17 @@ static int smb_full_audit_statvfs(struct vfs_handle_struct *handle,
        return result;
 }
 
+static int smb_full_audit_fs_capabilities(struct vfs_handle_struct *handle)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_FS_CAPABILITIES(handle);
+
+       do_log(SMB_VFS_OP_FS_CAPABILITIES, true, handle, "");
+
+       return result;
+}
+
 static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle,
                          const char *fname, const char *mask, uint32 attr)
 {
@@ -982,11 +1074,11 @@ static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle,
 }
 
 static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle,
-                                   SMB_STRUCT_DIR *dirp)
+                                   SMB_STRUCT_DIR *dirp, SMB_STRUCT_STAT *sbuf)
 {
        SMB_STRUCT_DIRENT *result;
 
-       result = SMB_VFS_NEXT_READDIR(handle, dirp);
+       result = SMB_VFS_NEXT_READDIR(handle, dirp, sbuf);
 
        /* This operation has no reasonable error condition
         * (End of dir is also failure), so always succeed.
@@ -1062,6 +1154,15 @@ static int smb_full_audit_closedir(vfs_handle_struct *handle,
        return result;
 }
 
+static void smb_full_audit_init_search_op(vfs_handle_struct *handle,
+                       SMB_STRUCT_DIR *dirp)
+{
+       SMB_VFS_NEXT_INIT_SEARCH_OP(handle, dirp);
+
+       do_log(SMB_VFS_OP_INIT_SEARCH_OP, True, handle, "");
+       return;
+}
+
 static int smb_full_audit_open(vfs_handle_struct *handle,
                      const char *fname, files_struct *fsp, int flags, mode_t mode)
 {
@@ -1076,11 +1177,56 @@ static int smb_full_audit_open(vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static NTSTATUS smb_full_audit_create_file(vfs_handle_struct *handle,
+                                     struct smb_request *req,
+                                     uint16_t root_dir_fid,
+                                     const char *fname,
+                                     uint32_t create_file_flags,
+                                     uint32_t access_mask,
+                                     uint32_t share_access,
+                                     uint32_t create_disposition,
+                                     uint32_t create_options,
+                                     uint32_t file_attributes,
+                                     uint32_t oplock_request,
+                                     uint64_t allocation_size,
+                                     struct security_descriptor *sd,
+                                     struct ea_list *ea_list,
+                                     files_struct **result_fsp,
+                                     int *pinfo,
+                                     SMB_STRUCT_STAT *psbuf)
+{
+       NTSTATUS result;
+
+       result = SMB_VFS_NEXT_CREATE_FILE(
+               handle,                                 /* handle */
+               req,                                    /* req */
+               root_dir_fid,                           /* root_dir_fid */
+               fname,                                  /* fname */
+               create_file_flags,                      /* create_file_flags */
+               access_mask,                            /* access_mask */
+               share_access,                           /* share_access */
+               create_disposition,                     /* create_disposition*/
+               create_options,                         /* create_options */
+               file_attributes,                        /* file_attributes */
+               oplock_request,                         /* oplock_request */
+               allocation_size,                        /* allocation_size */
+               sd,                                     /* sd */
+               ea_list,                                /* ea_list */
+               result_fsp,                             /* result */
+               pinfo,                                  /* pinfo */
+               psbuf);                                 /* psbuf */
+
+       do_log(SMB_VFS_OP_CREATE_FILE, (NT_STATUS_IS_OK(result)), handle, "0x%x|%s",
+              access_mask, fname);
+
+       return result;
+}
+
+static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp)
 {
        int result;
        
-       result = SMB_VFS_NEXT_CLOSE(handle, fsp, fd);
+       result = SMB_VFS_NEXT_CLOSE(handle, fsp);
 
        do_log(SMB_VFS_OP_CLOSE, (result >= 0), handle, "%s", fsp->fsp_name);
 
@@ -1088,11 +1234,11 @@ static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, in
 }
 
 static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
-                         int fd, void *data, size_t n)
+                         void *data, size_t n)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_READ(handle, fsp, fd, data, n);
+       result = SMB_VFS_NEXT_READ(handle, fsp, data, n);
 
        do_log(SMB_VFS_OP_READ, (result >= 0), handle, "%s", fsp->fsp_name);
 
@@ -1100,11 +1246,11 @@ static ssize_t smb_full_audit_read(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp,
-                          int fd, void *data, size_t n, SMB_OFF_T offset)
+                          void *data, size_t n, SMB_OFF_T offset)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_PREAD(handle, fsp, fd, data, n, offset);
+       result = SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
 
        do_log(SMB_VFS_OP_PREAD, (result >= 0), handle, "%s", fsp->fsp_name);
 
@@ -1112,11 +1258,11 @@ static ssize_t smb_full_audit_pread(vfs_handle_struct *handle, files_struct *fsp
 }
 
 static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp,
-                          int fd, const void *data, size_t n)
+                          const void *data, size_t n)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_WRITE(handle, fsp, fd, data, n);
+       result = SMB_VFS_NEXT_WRITE(handle, fsp, data, n);
 
        do_log(SMB_VFS_OP_WRITE, (result >= 0), handle, "%s", fsp->fsp_name);
 
@@ -1124,12 +1270,12 @@ static ssize_t smb_full_audit_write(vfs_handle_struct *handle, files_struct *fsp
 }
 
 static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fsp,
-                           int fd, const void *data, size_t n,
+                           const void *data, size_t n,
                            SMB_OFF_T offset)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_PWRITE(handle, fsp, fd, data, n, offset);
+       result = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
 
        do_log(SMB_VFS_OP_PWRITE, (result >= 0), handle, "%s", fsp->fsp_name);
 
@@ -1137,11 +1283,11 @@ static ssize_t smb_full_audit_pwrite(vfs_handle_struct *handle, files_struct *fs
 }
 
 static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *fsp,
-                            int filedes, SMB_OFF_T offset, int whence)
+                            SMB_OFF_T offset, int whence)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_LSEEK(handle, fsp, filedes, offset, whence);
+       result = SMB_VFS_NEXT_LSEEK(handle, fsp, offset, whence);
 
        do_log(SMB_VFS_OP_LSEEK, (result != (ssize_t)-1), handle,
               "%s", fsp->fsp_name);
@@ -1150,33 +1296,31 @@ static SMB_OFF_T smb_full_audit_lseek(vfs_handle_struct *handle, files_struct *f
 }
 
 static ssize_t smb_full_audit_sendfile(vfs_handle_struct *handle, int tofd,
-                             files_struct *fsp, int fromfd,
+                             files_struct *fromfsp,
                              const DATA_BLOB *hdr, SMB_OFF_T offset,
                              size_t n)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_SENDFILE(handle, tofd, fsp, fromfd, hdr,
-                                      offset, n);
+       result = SMB_VFS_NEXT_SENDFILE(handle, tofd, fromfsp, hdr, offset, n);
 
        do_log(SMB_VFS_OP_SENDFILE, (result >= 0), handle,
-              "%s", fsp->fsp_name);
+              "%s", fromfsp->fsp_name);
 
        return result;
 }
 
 static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd,
-                             files_struct *fsp, int tofd,
+                     files_struct *tofsp,
                              SMB_OFF_T offset,
                              size_t n)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, fsp, tofd,
-                                      offset, n);
+       result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
 
        do_log(SMB_VFS_OP_RECVFILE, (result >= 0), handle,
-              "%s", fsp->fsp_name);
+              "%s", tofsp->fsp_name);
 
        return result;
 }
@@ -1193,11 +1337,11 @@ static int smb_full_audit_rename(vfs_handle_struct *handle,
        return result;    
 }
 
-static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd)
+static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp)
 {
        int result;
        
-       result = SMB_VFS_NEXT_FSYNC(handle, fsp, fd);
+       result = SMB_VFS_NEXT_FSYNC(handle, fsp);
 
        do_log(SMB_VFS_OP_FSYNC, (result >= 0), handle, "%s", fsp->fsp_name);
 
@@ -1216,12 +1360,12 @@ static int smb_full_audit_stat(vfs_handle_struct *handle,
        return result;    
 }
 
-static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fstat(vfs_handle_struct *handle, files_struct *fsp,
                       SMB_STRUCT_STAT *sbuf)
 {
        int result;
        
-       result = SMB_VFS_NEXT_FSTAT(handle, fsp, fd, sbuf);
+       result = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
 
        do_log(SMB_VFS_OP_FSTAT, (result >= 0), handle, "%s", fsp->fsp_name);
 
@@ -1240,6 +1384,18 @@ static int smb_full_audit_lstat(vfs_handle_struct *handle,
        return result;    
 }
 
+static int smb_full_audit_get_alloc_size(vfs_handle_struct *handle,
+                      files_struct *fsp, const SMB_STRUCT_STAT *sbuf)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_GET_ALLOC_SIZE(handle, fsp, sbuf);
+
+       do_log(SMB_VFS_OP_GET_ALLOC_SIZE, (result >= 0), handle, "%d", result);
+
+       return result;
+}
+
 static int smb_full_audit_unlink(vfs_handle_struct *handle,
                        const char *path)
 {
@@ -1264,12 +1420,12 @@ static int smb_full_audit_chmod(vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp,
                        mode_t mode)
 {
        int result;
        
-       result = SMB_VFS_NEXT_FCHMOD(handle, fsp, fd, mode);
+       result = SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
 
        do_log(SMB_VFS_OP_FCHMOD, (result >= 0), handle,
               "%s|%o", fsp->fsp_name, mode);
@@ -1290,12 +1446,12 @@ static int smb_full_audit_chown(vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp,
                        uid_t uid, gid_t gid)
 {
        int result;
 
-       result = SMB_VFS_NEXT_FCHOWN(handle, fsp, fd, uid, gid);
+       result = SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
 
        do_log(SMB_VFS_OP_FCHOWN, (result >= 0), handle, "%s|%ld|%ld",
               fsp->fsp_name, (long int)uid, (long int)gid);
@@ -1341,11 +1497,11 @@ static char *smb_full_audit_getwd(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_ntimes(vfs_handle_struct *handle,
-                      const char *path, const struct timespec ts[2])
+                      const char *path, struct smb_file_time *ft)
 {
        int result;
 
-       result = SMB_VFS_NEXT_NTIMES(handle, path, ts);
+       result = SMB_VFS_NEXT_NTIMES(handle, path, ft);
 
        do_log(SMB_VFS_OP_NTIMES, (result >= 0), handle, "%s", path);
 
@@ -1353,11 +1509,11 @@ static int smb_full_audit_ntimes(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp,
-                          int fd, SMB_OFF_T len)
+                          SMB_OFF_T len)
 {
        int result;
 
-       result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, fd, len);
+       result = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, len);
 
        do_log(SMB_VFS_OP_FTRUNCATE, (result >= 0), handle,
               "%s", fsp->fsp_name);
@@ -1365,12 +1521,12 @@ static int smb_full_audit_ftruncate(vfs_handle_struct *handle, files_struct *fsp
        return result;
 }
 
-static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp,
                       int op, SMB_OFF_T offset, SMB_OFF_T count, int type)
 {
        bool result;
 
-       result = SMB_VFS_NEXT_LOCK(handle, fsp, fd, op, offset, count, type);
+       result = SMB_VFS_NEXT_LOCK(handle, fsp, op, offset, count, type);
 
        do_log(SMB_VFS_OP_LOCK, result, handle, "%s", fsp->fsp_name);
 
@@ -1378,12 +1534,12 @@ static bool smb_full_audit_lock(vfs_handle_struct *handle, files_struct *fsp, in
 }
 
 static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
-                                      struct files_struct *fsp, int fd,
+                                      struct files_struct *fsp,
                                       uint32 share_mode)
 {
        int result;
 
-       result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, fd, share_mode);
+       result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode);
 
        do_log(SMB_VFS_OP_KERNEL_FLOCK, (result >= 0), handle, "%s",
               fsp->fsp_name);
@@ -1392,11 +1548,11 @@ static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
-                                 int fd, int leasetype)
+                                 int leasetype)
 {
         int result;
 
-        result = SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, fd, leasetype);
+        result = SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
 
         do_log(SMB_VFS_OP_LINUX_SETLEASE, (result >= 0), handle, "%s",
                fsp->fsp_name);
@@ -1404,12 +1560,12 @@ static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct
         return result;
 }
 
-static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp, int fd,
+static bool smb_full_audit_getlock(vfs_handle_struct *handle, files_struct *fsp,
                       SMB_OFF_T *poffset, SMB_OFF_T *pcount, int *ptype, pid_t *ppid)
 {
        bool result;
 
-       result = SMB_VFS_NEXT_GETLOCK(handle, fsp, fd, poffset, pcount, ptype, ppid);
+       result = SMB_VFS_NEXT_GETLOCK(handle, fsp, poffset, pcount, ptype, ppid);
 
        do_log(SMB_VFS_OP_GETLOCK, result, handle, "%s", fsp->fsp_name);
 
@@ -1508,14 +1664,14 @@ static int smb_full_audit_chflags(vfs_handle_struct *handle,
 }
 
 static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle,
-                                                   SMB_DEV_T dev, SMB_INO_T inode)
+                                                   const SMB_STRUCT_STAT *sbuf)
 {
        struct file_id id_zero;
        struct file_id result;
 
        ZERO_STRUCT(id_zero);
 
-       result = SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode);
+       result = SMB_VFS_NEXT_FILE_ID_CREATE(handle, sbuf);
 
        do_log(SMB_VFS_OP_FILE_ID_CREATE,
               !file_id_equal(&id_zero, &result),
@@ -1524,6 +1680,92 @@ static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *ha
        return result;
 }
 
+static NTSTATUS smb_full_audit_streaminfo(vfs_handle_struct *handle,
+                                         struct files_struct *fsp,
+                                         const char *fname,
+                                         TALLOC_CTX *mem_ctx,
+                                         unsigned int *pnum_streams,
+                                         struct stream_struct **pstreams)
+{
+       NTSTATUS result;
+
+       result = SMB_VFS_NEXT_STREAMINFO(handle, fsp, fname, mem_ctx,
+                                        pnum_streams, pstreams);
+
+       do_log(SMB_VFS_OP_STREAMINFO, NT_STATUS_IS_OK(result), handle,
+              "%s", fname);
+
+       return result;
+}
+
+static int smb_full_audit_get_real_filename(struct vfs_handle_struct *handle,
+                                           const char *path,
+                                           const char *name,
+                                           TALLOC_CTX *mem_ctx,
+                                           char **found_name)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_GET_REAL_FILENAME(handle, path, name, mem_ctx,
+                                               found_name);
+
+       do_log(SMB_VFS_OP_GET_REAL_FILENAME, (result == 0), handle,
+              "%s/%s->%s", path, name, (result == 0) ? "" : *found_name);
+
+       return result;
+}
+
+static NTSTATUS smb_full_audit_brl_lock_windows(struct vfs_handle_struct *handle,
+                                               struct byte_range_lock *br_lck,
+                                               struct lock_struct *plock,
+                                               bool blocking_lock,
+                                               struct blocking_lock_record *blr)
+{
+       NTSTATUS result;
+
+       result = SMB_VFS_NEXT_BRL_LOCK_WINDOWS(handle, br_lck, plock,
+           blocking_lock, blr);
+
+       do_log(SMB_VFS_OP_BRL_LOCK_WINDOWS, NT_STATUS_IS_OK(result), handle,
+           "%s:%llu-%llu. type=%d. blocking=%d", br_lck->fsp->fsp_name,
+           plock->start, plock->size, plock->lock_type, blocking_lock );
+
+       return result;
+}
+
+static bool smb_full_audit_brl_unlock_windows(struct vfs_handle_struct *handle,
+                                             struct messaging_context *msg_ctx,
+                                             struct byte_range_lock *br_lck,
+                                             const struct lock_struct *plock)
+{
+       bool result;
+
+       result = SMB_VFS_NEXT_BRL_UNLOCK_WINDOWS(handle, msg_ctx, br_lck,
+           plock);
+
+       do_log(SMB_VFS_OP_BRL_UNLOCK_WINDOWS, (result == 0), handle,
+           "%s:%llu-%llu:%d", br_lck->fsp->fsp_name, plock->start,
+           plock->size, plock->lock_type);
+
+       return result;
+}
+
+static bool smb_full_audit_brl_cancel_windows(struct vfs_handle_struct *handle,
+                                             struct byte_range_lock *br_lck,
+                                             struct lock_struct *plock,
+                                             struct blocking_lock_record *blr)
+{
+       bool result;
+
+       result = SMB_VFS_NEXT_BRL_CANCEL_WINDOWS(handle, br_lck, plock, blr);
+
+       do_log(SMB_VFS_OP_BRL_CANCEL_WINDOWS, (result == 0), handle,
+           "%s:%llu-%llu:%d", br_lck->fsp->fsp_name, plock->start,
+           plock->size);
+
+       return result;
+}
+
 static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                                uint32 security_info,
                                SEC_DESC **ppdesc)
@@ -1539,7 +1781,6 @@ static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_stru
 }
 
 static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle,
-                                         files_struct *fsp,
                                          const char *name,
                                          uint32 security_info,
                                          SEC_DESC **ppdesc)
@@ -1549,14 +1790,14 @@ static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle,
        result = SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
 
        do_log(SMB_VFS_OP_GET_NT_ACL, NT_STATUS_IS_OK(result), handle,
-              "%s", fsp->fsp_name);
+              "%s", name);
 
        return result;
 }
 
 static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                              uint32 security_info_sent,
-                             SEC_DESC *psd)
+                             const SEC_DESC *psd)
 {
        NTSTATUS result;
 
@@ -1567,20 +1808,6 @@ static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_stru
        return result;
 }
 
-static NTSTATUS smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                            const char *name, uint32 security_info_sent,
-                            SEC_DESC *psd)
-{
-       NTSTATUS result;
-
-       result = SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent,
-                                        psd);
-
-       do_log(SMB_VFS_OP_SET_NT_ACL, NT_STATUS_IS_OK(result), handle, "%s", fsp->fsp_name);
-
-       return result;
-}
-
 static int smb_full_audit_chmod_acl(vfs_handle_struct *handle,
                           const char *path, mode_t mode)
 {
@@ -1595,11 +1822,11 @@ static int smb_full_audit_chmod_acl(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
-                           int fd, mode_t mode)
+                                    mode_t mode)
 {
        int result;
        
-       result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, fd, mode);
+       result = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
 
        do_log(SMB_VFS_OP_FCHMOD_ACL, (result >= 0), handle,
               "%s|%o", fsp->fsp_name, mode);
@@ -1684,11 +1911,11 @@ static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle,
 }
 
 static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle,
-                                     files_struct *fsp, int fd)
+                                     files_struct *fsp)
 {
        SMB_ACL_T result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, fd);
+       result = SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp);
 
        do_log(SMB_VFS_OP_SYS_ACL_GET_FD, (result != NULL), handle,
               "%s", fsp->fsp_name);
@@ -1844,11 +2071,11 @@ static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
-                               int fd, SMB_ACL_T theacl)
+                               SMB_ACL_T theacl)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, fd, theacl);
+       result = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
 
        do_log(SMB_VFS_OP_SYS_ACL_SET_FD, (result >= 0), handle,
               "%s", fsp->fsp_name);
@@ -1957,12 +2184,12 @@ static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle,
 }
 
 static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle,
-                              struct files_struct *fsp, int fd,
+                              struct files_struct *fsp,
                               const char *name, void *value, size_t size)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_FGETXATTR(handle, fsp, fd, name, value, size);
+       result = SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
 
        do_log(SMB_VFS_OP_FGETXATTR, (result >= 0), handle,
               "%s|%s", fsp->fsp_name, name);
@@ -1995,12 +2222,12 @@ static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle,
 }
 
 static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle,
-                               struct files_struct *fsp, int fd, char *list,
+                               struct files_struct *fsp, char *list,
                                size_t size)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_FLISTXATTR(handle, fsp, fd, list, size);
+       result = SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
 
        do_log(SMB_VFS_OP_FLISTXATTR, (result >= 0), handle,
               "%s", fsp->fsp_name);
@@ -2037,12 +2264,12 @@ static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle,
-                             struct files_struct *fsp, int fd,
+                             struct files_struct *fsp,
                              const char *name)
 {
        int result;
 
-       result = SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, fd, name);
+       result = SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
 
        do_log(SMB_VFS_OP_FREMOVEXATTR, (result >= 0), handle,
               "%s|%s", fsp->fsp_name, name);
@@ -2083,13 +2310,12 @@ static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle,
-                          struct files_struct *fsp, int fd, const char *name,
+                          struct files_struct *fsp, const char *name,
                           const void *value, size_t size, int flags)
 {
        int result;
 
-       result = SMB_VFS_NEXT_FSETXATTR(handle, fsp, fd, name, value, size,
-                                       flags);
+       result = SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
 
        do_log(SMB_VFS_OP_FSETXATTR, (result >= 0), handle,
               "%s|%s", fsp->fsp_name, name);
@@ -2130,11 +2356,11 @@ static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struc
        return result;
 }
 
-static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, int fd, SMB_STRUCT_AIOCB *aiocb)
+static int smb_full_audit_aio_cancel(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
 {
        int result;
 
-       result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, fd, aiocb);
+       result = SMB_VFS_NEXT_AIO_CANCEL(handle, fsp, aiocb);
        do_log(SMB_VFS_OP_AIO_CANCEL, (result >= 0), handle,
                "%s", fsp->fsp_name);
 
@@ -2174,6 +2400,17 @@ static int smb_full_audit_aio_suspend(struct vfs_handle_struct *handle, struct f
        return result;
 }
 
+static bool smb_full_audit_aio_force(struct vfs_handle_struct *handle,
+                                    struct files_struct *fsp)
+{
+       bool result;
+
+       result = SMB_VFS_NEXT_AIO_FORCE(handle, fsp);
+       do_log(SMB_VFS_OP_AIO_FORCE, result, handle,
+               "%s", fsp->fsp_name);
+
+       return result;
+}
 
 NTSTATUS vfs_full_audit_init(void);
 NTSTATUS vfs_full_audit_init(void)