Update vfs version as I've added a const to the security_descriptor paramter in fset_...
[jra/samba/.git] / source3 / modules / vfs_full_audit.c
index 3c0098408ef27228408e1fcddc0ff3973e7e0213..9fadcd9e0cb994471fd5dd02f8520c6586defcd7 100644 (file)
@@ -10,7 +10,7 @@
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *  
  * This program is distributed in the hope that it will be useful,
@@ -19,8 +19,7 @@
  * GNU General Public License for more details.
  *  
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -35,6 +34,9 @@
  * full_audit:success = open opendir
  * full_audit:failure = all
  *
+ * vfs op can be "all" which means log all operations.
+ * vfs op can be "none" which means no logging.
+ *
  * This leads to syslog entries of the form:
  * smbd_audit: nobody|192.168.234.1|opendir|ok|.
  * smbd_audit: nobody|192.168.234.1|open|fail (File not found)|r|x.txt
 
 #include "includes.h"
 
-extern struct current_user current_user;
-
 static int vfs_full_audit_debug_level = DBGC_VFS;
 
+struct vfs_full_audit_private_data {
+       struct bitmap *success_ops;
+       struct bitmap *failure_ops;
+};
+
 #undef DBGC_CLASS
 #define DBGC_CLASS vfs_full_audit_debug_level
 
 /* Function prototypes */
 
-static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct *conn,
+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,
-                            connection_struct *conn);
+static void smb_full_audit_disconnect(vfs_handle_struct *handle);
 static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle,
-                                   connection_struct *conn, const char *path,
-                                   BOOL small_query, SMB_BIG_UINT *bsize, 
+                                   const char *path,
+                                   bool small_query, SMB_BIG_UINT *bsize, 
                                    SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize);
 static int smb_full_audit_get_quota(struct vfs_handle_struct *handle,
-                          struct connection_struct *conn,
                           enum SMB_QUOTA_TYPE qtype, unid_t id,
                           SMB_DISK_QUOTA *qt);
 static int smb_full_audit_set_quota(struct vfs_handle_struct *handle,
-                          struct connection_struct *conn,
                           enum SMB_QUOTA_TYPE qtype, unid_t id,
                           SMB_DISK_QUOTA *qt);
 static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
                                 struct files_struct *fsp,
-                                SHADOW_COPY_DATA *shadow_copy_data, BOOL labels);
+                                SHADOW_COPY_DATA *shadow_copy_data, bool labels);
+static int smb_full_audit_statvfs(struct vfs_handle_struct *handle,
+                               const char *path,
+                               struct vfs_statvfs_struct *statbuf);
 
-static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn,
-                         const char *fname);
+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,
-                                   connection_struct *conn, DIR *dirp);
-static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn,
-                       DIR *dirp, long offset);
-static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn,
-                       DIR *dirp);
-static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn,
-                       DIR *dirp);
-static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn,
+                                   SMB_STRUCT_DIR *dirp);
+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,
+                       SMB_STRUCT_DIR *dirp);
+static void smb_full_audit_rewinddir(vfs_handle_struct *handle,
+                       SMB_STRUCT_DIR *dirp);
+static int smb_full_audit_mkdir(vfs_handle_struct *handle,
                       const char *path, mode_t mode);
-static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_rmdir(vfs_handle_struct *handle,
                       const char *path);
-static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn,
-                         DIR *dirp);
-static int smb_full_audit_open(vfs_handle_struct *handle, connection_struct *conn,
-                     const char *fname, int flags, mode_t mode);
-static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd);
+static int smb_full_audit_closedir(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);
 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 int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn,
-                       const char *old, const char *new);
-static int smb_full_audit_fsync(vfs_handle_struct *handle, files_struct *fsp, int fd);
-static int smb_full_audit_stat(vfs_handle_struct *handle, connection_struct *conn,
+static ssize_t smb_full_audit_recvfile(vfs_handle_struct *handle, int fromfd,
+                             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);
+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, connection_struct *conn,
+static int smb_full_audit_lstat(vfs_handle_struct *handle,
                       const char *path, SMB_STRUCT_STAT *sbuf);
-static int smb_full_audit_unlink(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_unlink(vfs_handle_struct *handle,
                        const char *path);
-static int smb_full_audit_chmod(vfs_handle_struct *handle, connection_struct *conn,
+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, connection_struct *conn,
+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_chdir(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_lchown(vfs_handle_struct *handle,
+                      const char *path, uid_t uid, gid_t gid);
+static int smb_full_audit_chdir(vfs_handle_struct *handle,
                       const char *path);
-static char *smb_full_audit_getwd(vfs_handle_struct *handle, connection_struct *conn,
+static char *smb_full_audit_getwd(vfs_handle_struct *handle,
                         char *path);
-static int smb_full_audit_utime(vfs_handle_struct *handle, connection_struct *conn,
-                      const char *path, struct utimbuf *times);
+static int smb_full_audit_ntimes(vfs_handle_struct *handle,
+                      const char *path, const struct timespec ts[2]);
 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_symlink(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
+                                      struct files_struct *fsp,
+                                      uint32 share_mode);
+static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
+                                       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);
-static int smb_full_audit_readlink(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_readlink(vfs_handle_struct *handle,
                          const char *path, char *buf, size_t bufsiz);
-static int smb_full_audit_link(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_link(vfs_handle_struct *handle,
                      const char *oldpath, const char *newpath);
-static int smb_full_audit_mknod(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_mknod(vfs_handle_struct *handle,
                       const char *pathname, mode_t mode, SMB_DEV_T dev);
-static char *smb_full_audit_realpath(vfs_handle_struct *handle, connection_struct *conn,
+static char *smb_full_audit_realpath(vfs_handle_struct *handle,
                            const char *path, char *resolved_path);
-static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                               int fd, uint32 security_info,
+static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle,
+                       struct sys_notify_context *ctx,
+                       struct notify_entry *e,
+                       void (*callback)(struct sys_notify_context *ctx,
+                                       void *private_data,
+                                       struct notify_event *ev),
+                       void *private_data, void *handle_p);
+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);
+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 NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
+                               uint32 security_info,
                                SEC_DESC **ppdesc);
-static size_t 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 BOOL smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                             int fd, uint32 security_info_sent,
-                             SEC_DESC *psd);
-static BOOL smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                            const char *name, uint32 security_info_sent,
-                            SEC_DESC *psd);
-static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, connection_struct *conn,
+static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
+                             uint32 security_info_sent,
+                             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,
-                                  connection_struct *conn,
                                   SMB_ACL_T theacl, int entry_id,
                                   SMB_ACL_ENTRY_T *entry_p);
 static int smb_full_audit_sys_acl_get_tag_type(vfs_handle_struct *handle,
-                                     connection_struct *conn,
                                      SMB_ACL_ENTRY_T entry_d,
                                      SMB_ACL_TAG_T *tag_type_p);
 static int smb_full_audit_sys_acl_get_permset(vfs_handle_struct *handle,
-                                    connection_struct *conn,
                                     SMB_ACL_ENTRY_T entry_d,
                                     SMB_ACL_PERMSET_T *permset_p);
 static void * smb_full_audit_sys_acl_get_qualifier(vfs_handle_struct *handle,
-                                         connection_struct *conn,
                                          SMB_ACL_ENTRY_T entry_d);
 static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle,
-                                       connection_struct *conn,
                                        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,
-                                    connection_struct *conn,
                                     SMB_ACL_PERMSET_T permset);
 static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle,
-                                 connection_struct *conn,
                                  SMB_ACL_PERMSET_T permset,
                                  SMB_ACL_PERM_T perm);
 static char * smb_full_audit_sys_acl_to_text(vfs_handle_struct *handle,
-                                   connection_struct *conn, SMB_ACL_T theacl,
+                                   SMB_ACL_T theacl,
                                    ssize_t *plen);
 static SMB_ACL_T smb_full_audit_sys_acl_init(vfs_handle_struct *handle,
-                                   connection_struct *conn,
                                    int count);
 static int smb_full_audit_sys_acl_create_entry(vfs_handle_struct *handle,
-                                     connection_struct *conn, SMB_ACL_T *pacl,
+                                     SMB_ACL_T *pacl,
                                      SMB_ACL_ENTRY_T *pentry);
 static int smb_full_audit_sys_acl_set_tag_type(vfs_handle_struct *handle,
-                                     connection_struct *conn,
                                      SMB_ACL_ENTRY_T entry,
                                      SMB_ACL_TAG_T tagtype);
 static int smb_full_audit_sys_acl_set_qualifier(vfs_handle_struct *handle,
-                                      connection_struct *conn,
                                       SMB_ACL_ENTRY_T entry,
                                       void *qual);
 static int smb_full_audit_sys_acl_set_permset(vfs_handle_struct *handle,
-                                    connection_struct *conn,
                                     SMB_ACL_ENTRY_T entry,
                                     SMB_ACL_PERMSET_T permset);
 static int smb_full_audit_sys_acl_valid(vfs_handle_struct *handle,
-                              connection_struct *conn,
                               SMB_ACL_T theacl );
 static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
-                                 connection_struct *conn,
                                  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,
-                                        connection_struct *conn,
                                         const char *path);
 static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle,
-                                 connection_struct *conn,
                                  SMB_ACL_PERMSET_T permset,
                                  SMB_ACL_PERM_T perm);
 static int smb_full_audit_sys_acl_free_text(vfs_handle_struct *handle,
-                                  connection_struct *conn,
                                   char *text);
 static int smb_full_audit_sys_acl_free_acl(vfs_handle_struct *handle,
-                                 connection_struct *conn,
                                  SMB_ACL_T posix_acl);
 static int smb_full_audit_sys_acl_free_qualifier(vfs_handle_struct *handle,
-                                       connection_struct *conn,
                                        void *qualifier,
                                        SMB_ACL_TAG_T tagtype);
 static ssize_t smb_full_audit_getxattr(struct vfs_handle_struct *handle,
-                             struct connection_struct *conn, const char *path,
+                             const char *path,
                              const char *name, void *value, size_t size);
 static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle,
-                              struct connection_struct *conn,
                               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,
-                              struct connection_struct *conn,
                               const char *path, char *list, size_t size);
 static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle,
-                               struct connection_struct *conn,
                                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,
-                            struct connection_struct *conn, const char *path,
+                            const char *path,
                             const char *name);
 static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle,
-                             struct connection_struct *conn, const char *path,
+                             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,
-                         struct connection_struct *conn, const char *path,
+                         const char *path,
                          const char *name, const void *value, size_t size,
                          int flags);
 static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle,
-                          struct connection_struct *conn, const char *path,
+                          const char *path,
                           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, 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);
+
 /* VFS operations */
 
 static vfs_op_tuple audit_op_tuples[] = {
@@ -309,6 +327,8 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_get_shadow_copy_data), SMB_VFS_OP_GET_SHADOW_COPY_DATA,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_statvfs),    SMB_VFS_OP_STATVFS,
+        SMB_VFS_LAYER_LOGGER},
 
        /* Directory operations */
 
@@ -347,6 +367,8 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_sendfile),   SMB_VFS_OP_SENDFILE,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_recvfile),   SMB_VFS_OP_RECVFILE,
+        SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_rename),     SMB_VFS_OP_RENAME,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_fsync),      SMB_VFS_OP_FSYNC,
@@ -367,16 +389,24 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_fchown),     SMB_VFS_OP_FCHOWN,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_lchown),     SMB_VFS_OP_LCHOWN,
+        SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_chdir),      SMB_VFS_OP_CHDIR,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_getwd),      SMB_VFS_OP_GETWD,
         SMB_VFS_LAYER_LOGGER},
-       {SMB_VFS_OP(smb_full_audit_utime),      SMB_VFS_OP_UTIME,
+       {SMB_VFS_OP(smb_full_audit_ntimes),     SMB_VFS_OP_NTIMES,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_ftruncate),  SMB_VFS_OP_FTRUNCATE,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_lock),       SMB_VFS_OP_LOCK,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_kernel_flock),       SMB_VFS_OP_KERNEL_FLOCK,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_linux_setlease),       SMB_VFS_OP_LINUX_SETLEASE,
+         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_getlock),    SMB_VFS_OP_GETLOCK,
+        SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_symlink),    SMB_VFS_OP_SYMLINK,
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_readlink),   SMB_VFS_OP_READLINK,
@@ -387,6 +417,14 @@ static vfs_op_tuple audit_op_tuples[] = {
         SMB_VFS_LAYER_LOGGER},
        {SMB_VFS_OP(smb_full_audit_realpath),   SMB_VFS_OP_REALPATH,
         SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_notify_watch),SMB_VFS_OP_NOTIFY_WATCH,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_chflags),    SMB_VFS_OP_CHFLAGS,
+        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},
 
        /* NT ACL operations. */
 
@@ -396,8 +434,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. */
 
@@ -415,7 +451,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},
@@ -477,6 +513,21 @@ static vfs_op_tuple audit_op_tuples[] = {
        {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,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_aio_return), SMB_VFS_OP_AIO_RETURN,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_aio_cancel), SMB_VFS_OP_AIO_CANCEL,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_aio_error),  SMB_VFS_OP_AIO_ERROR,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_aio_fsync),  SMB_VFS_OP_AIO_FSYNC,
+        SMB_VFS_LAYER_LOGGER},
+       {SMB_VFS_OP(smb_full_audit_aio_suspend),SMB_VFS_OP_AIO_SUSPEND,
+        SMB_VFS_LAYER_LOGGER},
+
        /* Finish VFS operations definition */
        
        {SMB_VFS_OP(NULL),              SMB_VFS_OP_NOOP,
@@ -495,6 +546,8 @@ static struct {
        { SMB_VFS_OP_GET_QUOTA, "get_quota" },
        { 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" },
@@ -511,6 +564,7 @@ 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" },
@@ -521,20 +575,27 @@ static struct {
        { SMB_VFS_OP_FCHMOD,    "fchmod" },
        { SMB_VFS_OP_CHOWN,     "chown" },
        { SMB_VFS_OP_FCHOWN,    "fchown" },
+       { SMB_VFS_OP_LCHOWN,    "lchown" },
        { SMB_VFS_OP_CHDIR,     "chdir" },
        { SMB_VFS_OP_GETWD,     "getwd" },
-       { SMB_VFS_OP_UTIME,     "utime" },
+       { SMB_VFS_OP_NTIMES,    "ntimes" },
        { SMB_VFS_OP_FTRUNCATE, "ftruncate" },
        { SMB_VFS_OP_LOCK,      "lock" },
+       { SMB_VFS_OP_KERNEL_FLOCK,      "kernel_flock" },
+       { SMB_VFS_OP_LINUX_SETLEASE, "linux_setlease" },
+       { SMB_VFS_OP_GETLOCK,   "getlock" },
        { SMB_VFS_OP_SYMLINK,   "symlink" },
        { SMB_VFS_OP_READLINK,  "readlink" },
        { SMB_VFS_OP_LINK,      "link" },
        { SMB_VFS_OP_MKNOD,     "mknod" },
        { SMB_VFS_OP_REALPATH,  "realpath" },
+       { 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_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" },
@@ -571,64 +632,116 @@ static struct {
        { SMB_VFS_OP_SETXATTR,  "setxattr" },
        { SMB_VFS_OP_LSETXATTR, "lsetxattr" },
        { SMB_VFS_OP_FSETXATTR, "fsetxattr" },
+       { SMB_VFS_OP_AIO_READ,  "aio_read" },
+       { SMB_VFS_OP_AIO_WRITE, "aio_write" },
+       { SMB_VFS_OP_AIO_RETURN,"aio_return" },
+       { SMB_VFS_OP_AIO_CANCEL,"aio_cancel" },
+       { 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)
 {
-       /* fix me: let this be configurable by:
-        *      lp_param_enum(SNUM(handle->conn),
-        *                    (handle->param?handle->param:"full_audit"),
-        *                    "syslog facility",
-        *                    audit_enum_facility,LOG_USER);
-        */
-       return LOG_USER;
+       static const struct enum_list enum_log_facilities[] = {
+               { LOG_USER, "USER" },
+               { LOG_LOCAL0, "LOCAL0" },
+               { LOG_LOCAL1, "LOCAL1" },
+               { LOG_LOCAL2, "LOCAL2" },
+               { LOG_LOCAL3, "LOCAL3" },
+               { LOG_LOCAL4, "LOCAL4" },
+               { LOG_LOCAL5, "LOCAL5" },
+               { LOG_LOCAL6, "LOCAL6" },
+               { LOG_LOCAL7, "LOCAL7" }
+       };
+
+       int facility;
+
+       facility = lp_parm_enum(SNUM(handle->conn), "full_audit", "facility", enum_log_facilities, LOG_USER);
+
+       return facility;
 }
 
 static int audit_syslog_priority(vfs_handle_struct *handle)
 {
-       /* fix me: let this be configurable by:
-        *      lp_param_enum(SNUM(handle->conn),
-        *                    (handle->param?handle->param:"full_audit"),
-        *                    "syslog priority",
-        *                    audit_enum_priority,LOG_NOTICE); 
-        */
-       return LOG_NOTICE;
+       static const struct enum_list enum_log_priorities[] = {
+               { LOG_EMERG, "EMERG" },
+               { LOG_ALERT, "ALERT" },
+               { LOG_CRIT, "CRIT" },
+               { LOG_ERR, "ERR" },
+               { LOG_WARNING, "WARNING" },
+               { LOG_NOTICE, "NOTICE" },
+               { LOG_INFO, "INFO" },
+               { LOG_DEBUG, "DEBUG" }
+       };
+
+       int priority;
+
+       priority = lp_parm_enum(SNUM(handle->conn), "full_audit", "priority",
+                               enum_log_priorities, LOG_NOTICE);
+       if (priority == -1) {
+               priority = LOG_WARNING;
+       }
+
+       return priority;
 }
 
-static char *audit_prefix(connection_struct *conn)
+static char *audit_prefix(TALLOC_CTX *ctx, connection_struct *conn)
 {
-       static pstring prefix;
+       char *prefix = NULL;
 
-       pstrcpy(prefix, lp_parm_const_string(SNUM(conn), "full_audit",
+       prefix = talloc_strdup(ctx,
+                       lp_parm_const_string(SNUM(conn), "full_audit",
                                             "prefix", "%u|%I"));
-       standard_sub_snum(SNUM(conn), prefix, sizeof(prefix)-1);
-       return prefix;
+       if (!prefix) {
+               return NULL;
+       }
+       return 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);
 }
 
-static struct bitmap *success_ops = NULL;
-
-static BOOL log_success(vfs_op_type op)
+static bool log_success(vfs_handle_struct *handle, vfs_op_type op)
 {
-       if (success_ops == NULL)
+       struct vfs_full_audit_private_data *pd = NULL;
+
+       SMB_VFS_HANDLE_GET_DATA(handle, pd,
+               struct vfs_full_audit_private_data,
+               return True);
+
+       if (pd->success_ops == NULL) {
                return True;
+       }
 
-       return bitmap_query(success_ops, op);
+       return bitmap_query(pd->success_ops, op);
 }
 
-static struct bitmap *failure_ops = NULL;
-
-static BOOL log_failure(vfs_op_type op)
+static bool log_failure(vfs_handle_struct *handle, vfs_op_type op)
 {
-       if (failure_ops == NULL)
+       struct vfs_full_audit_private_data *pd = NULL;
+
+       SMB_VFS_HANDLE_GET_DATA(handle, pd,
+               struct vfs_full_audit_private_data,
+               return True);
+
+       if (pd->failure_ops == NULL)
                return True;
 
-       return bitmap_query(failure_ops, op);
+       return bitmap_query(pd->failure_ops, op);
 }
 
 static void init_bitmap(struct bitmap **bm, const char **ops)
 {
-       BOOL log_all = False;
+       bool log_all = False;
 
        if (*bm != NULL)
                return;
@@ -643,13 +756,17 @@ static void init_bitmap(struct bitmap **bm, const char **ops)
 
        while (*ops != NULL) {
                int i;
-               BOOL found = False;
+               bool found = False;
 
                if (strequal(*ops, "all")) {
                        log_all = True;
                        break;
                }
 
+               if (strequal(*ops, "none")) {
+                       break;
+               }
+
                for (i=0; i<SMB_VFS_OP_LAST; i++) {
                        if (vfs_op_names[i].name == NULL) {
                                smb_panic("vfs_full_audit.c: name table not "
@@ -684,17 +801,18 @@ static const char *audit_opname(vfs_op_type op)
        return vfs_op_names[op].name;
 }
 
-static void do_log(vfs_op_type op, BOOL success, vfs_handle_struct *handle,
+static void do_log(vfs_op_type op, bool success, vfs_handle_struct *handle,
                   const char *format, ...)
 {
        fstring err_msg;
-       pstring op_msg;
+       char *audit_pre = NULL;
        va_list ap;
+       char *op_msg = NULL;
 
-       if (success && (!log_success(op)))
+       if (success && (!log_success(handle, op)))
                return;
 
-       if (!success && (!log_failure(op)))
+       if (!success && (!log_failure(handle, op)))
                return;
 
        if (success)
@@ -703,35 +821,75 @@ 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);
-       vsnprintf(op_msg, sizeof(op_msg), format, ap);
+       op_msg = talloc_vasprintf(NULL, format, ap);
        va_end(ap);
 
+       if (!op_msg) {
+               return;
+       }
+
+       audit_pre = audit_prefix(NULL, handle->conn);
        syslog(audit_syslog_priority(handle), "%s|%s|%s|%s\n",
-              audit_prefix(handle->conn), audit_opname(op), err_msg, op_msg);
+               audit_pre ? audit_pre : "",
+               audit_opname(op), err_msg, op_msg);
+
+       TALLOC_FREE(audit_pre);
+       TALLOC_FREE(op_msg);
 
        return;
 }
 
+/* Free function for the private data. */
+
+static void free_private_data(void **p_data)
+{
+       struct vfs_full_audit_private_data *pd = *(struct vfs_full_audit_private_data **)p_data;
+
+       if (pd->success_ops) {
+               bitmap_free(pd->success_ops);
+       }
+       if (pd->failure_ops) {
+               bitmap_free(pd->failure_ops);
+       }
+       SAFE_FREE(pd);
+       *p_data = NULL;
+}
+
 /* Implementation of vfs_ops.  Pass everything on to the default
    operation but log event first. */
 
-static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_connect(vfs_handle_struct *handle,
                         const char *svc, const char *user)
 {
        int result;
+       struct vfs_full_audit_private_data *pd = NULL;
        const char *none[] = { NULL };
        const char *all [] = { "all" };
 
+       if (!handle) {
+               return -1;
+       }
+
+       pd = SMB_MALLOC_P(struct vfs_full_audit_private_data);
+       if (!pd) {
+               return -1;
+       }
+       ZERO_STRUCTP(pd);
+
        openlog("smbd_audit", 0, audit_syslog_facility(handle));
 
-       init_bitmap(&success_ops,
-                   lp_parm_string_list(SNUM(conn), "full_audit", "success",
+       init_bitmap(&pd->success_ops,
+                   lp_parm_string_list(SNUM(handle->conn), "full_audit", "success",
                                        none));
-       init_bitmap(&failure_ops,
-                   lp_parm_string_list(SNUM(conn), "full_audit", "failure",
+       init_bitmap(&pd->failure_ops,
+                   lp_parm_string_list(SNUM(handle->conn), "full_audit", "failure",
                                        all));
 
-       result = SMB_VFS_NEXT_CONNECT(handle, conn, svc, user);
+       /* Store the private data. */
+       SMB_VFS_HANDLE_SET_DATA(handle, pd, free_private_data,
+                               struct vfs_full_audit_private_data, return -1);
+
+       result = SMB_VFS_NEXT_CONNECT(handle, svc, user);
 
        do_log(SMB_VFS_OP_CONNECT, True, handle,
               "%s", svc);
@@ -739,31 +897,27 @@ static int smb_full_audit_connect(vfs_handle_struct *handle, connection_struct *
        return result;
 }
 
-static void smb_full_audit_disconnect(vfs_handle_struct *handle,
-                            connection_struct *conn)
+static void smb_full_audit_disconnect(vfs_handle_struct *handle)
 {
-       SMB_VFS_NEXT_DISCONNECT(handle, conn);
+       SMB_VFS_NEXT_DISCONNECT(handle);
 
        do_log(SMB_VFS_OP_DISCONNECT, True, handle,
-              "%s", lp_servicename(SNUM(conn)));
+              "%s", lp_servicename(SNUM(handle->conn)));
 
-       bitmap_free(success_ops);
-       success_ops = NULL;
-
-       bitmap_free(failure_ops);
-       failure_ops = NULL;
+       /* The bitmaps will be disconnected when the private
+          data is deleted. */
 
        return;
 }
 
 static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle,
-                                   connection_struct *conn, const char *path,
-                                   BOOL small_query, SMB_BIG_UINT *bsize, 
+                                   const char *path,
+                                   bool small_query, SMB_BIG_UINT *bsize, 
                                    SMB_BIG_UINT *dfree, SMB_BIG_UINT *dsize)
 {
        SMB_BIG_UINT result;
 
-       result = SMB_VFS_NEXT_DISK_FREE(handle, conn, path, small_query, bsize,
+       result = SMB_VFS_NEXT_DISK_FREE(handle, path, small_query, bsize,
                                        dfree, dsize);
 
        /* Don't have a reasonable notion of failure here */
@@ -774,13 +928,12 @@ static SMB_BIG_UINT smb_full_audit_disk_free(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_get_quota(struct vfs_handle_struct *handle,
-                          struct connection_struct *conn,
                           enum SMB_QUOTA_TYPE qtype, unid_t id,
                           SMB_DISK_QUOTA *qt)
 {
        int result;
 
-       result = SMB_VFS_NEXT_GET_QUOTA(handle, conn, qtype, id, qt);
+       result = SMB_VFS_NEXT_GET_QUOTA(handle, qtype, id, qt);
 
        do_log(SMB_VFS_OP_GET_QUOTA, (result >= 0), handle, "");
 
@@ -789,13 +942,12 @@ static int smb_full_audit_get_quota(struct vfs_handle_struct *handle,
 
        
 static int smb_full_audit_set_quota(struct vfs_handle_struct *handle,
-                          struct connection_struct *conn,
                           enum SMB_QUOTA_TYPE qtype, unid_t id,
                           SMB_DISK_QUOTA *qt)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SET_QUOTA(handle, conn, qtype, id, qt);
+       result = SMB_VFS_NEXT_SET_QUOTA(handle, qtype, id, qt);
 
        do_log(SMB_VFS_OP_SET_QUOTA, (result >= 0), handle, "");
 
@@ -804,7 +956,7 @@ static int smb_full_audit_set_quota(struct vfs_handle_struct *handle,
 
 static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
                                struct files_struct *fsp,
-                               SHADOW_COPY_DATA *shadow_copy_data, BOOL labels)
+                               SHADOW_COPY_DATA *shadow_copy_data, bool labels)
 {
        int result;
 
@@ -815,12 +967,25 @@ static int smb_full_audit_get_shadow_copy_data(struct vfs_handle_struct *handle,
        return result;
 }
 
-static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct *conn,
-                         const char *fname)
+static int smb_full_audit_statvfs(struct vfs_handle_struct *handle,
+                               const char *path,
+                               struct vfs_statvfs_struct *statbuf)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_STATVFS(handle, path, statbuf);
+
+       do_log(SMB_VFS_OP_STATVFS, (result >= 0), handle, "");
+
+       return result;
+}
+
+static SMB_STRUCT_DIR *smb_full_audit_opendir(vfs_handle_struct *handle,
+                         const char *fname, const char *mask, uint32 attr)
 {
-       DIR *result;
+       SMB_STRUCT_DIR *result;
 
-       result = SMB_VFS_NEXT_OPENDIR(handle, conn, fname);
+       result = SMB_VFS_NEXT_OPENDIR(handle, fname, mask, attr);
 
        do_log(SMB_VFS_OP_OPENDIR, (result != NULL), handle, "%s", fname);
 
@@ -828,11 +993,11 @@ static DIR *smb_full_audit_opendir(vfs_handle_struct *handle, connection_struct
 }
 
 static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle,
-                                   connection_struct *conn, DIR *dirp)
+                                   SMB_STRUCT_DIR *dirp)
 {
        SMB_STRUCT_DIRENT *result;
 
-       result = SMB_VFS_NEXT_READDIR(handle, conn, dirp);
+       result = SMB_VFS_NEXT_READDIR(handle, dirp);
 
        /* This operation has no reasonable error condition
         * (End of dir is also failure), so always succeed.
@@ -842,78 +1007,78 @@ static SMB_STRUCT_DIRENT *smb_full_audit_readdir(vfs_handle_struct *handle,
        return result;
 }
 
-static void smb_full_audit_seekdir(vfs_handle_struct *handle, connection_struct *conn,
-                       DIR *dirp, long offset)
+static void smb_full_audit_seekdir(vfs_handle_struct *handle,
+                       SMB_STRUCT_DIR *dirp, long offset)
 {
-       SMB_VFS_NEXT_SEEKDIR(handle, conn, dirp, offset);
+       SMB_VFS_NEXT_SEEKDIR(handle, dirp, offset);
 
        do_log(SMB_VFS_OP_SEEKDIR, True, handle, "");
        return;
 }
 
-static long smb_full_audit_telldir(vfs_handle_struct *handle, connection_struct *conn,
-                       DIR *dirp)
+static long smb_full_audit_telldir(vfs_handle_struct *handle,
+                       SMB_STRUCT_DIR *dirp)
 {
        long result;
 
-       result = SMB_VFS_NEXT_TELLDIR(handle, conn, dirp);
+       result = SMB_VFS_NEXT_TELLDIR(handle, dirp);
 
-       do_log(SMB_VFS_OP_OPENDIR, True, handle, "");
+       do_log(SMB_VFS_OP_TELLDIR, True, handle, "");
 
        return result;
 }
 
-static void smb_full_audit_rewinddir(vfs_handle_struct *handle, connection_struct *conn,
-                       DIR *dirp)
+static void smb_full_audit_rewinddir(vfs_handle_struct *handle,
+                       SMB_STRUCT_DIR *dirp)
 {
-       SMB_VFS_NEXT_REWINDDIR(handle, conn, dirp);
+       SMB_VFS_NEXT_REWINDDIR(handle, dirp);
 
        do_log(SMB_VFS_OP_REWINDDIR, True, handle, "");
        return;
 }
 
-static int smb_full_audit_mkdir(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_mkdir(vfs_handle_struct *handle,
                       const char *path, mode_t mode)
 {
        int result;
        
-       result = SMB_VFS_NEXT_MKDIR(handle, conn, path, mode);
+       result = SMB_VFS_NEXT_MKDIR(handle, path, mode);
        
        do_log(SMB_VFS_OP_MKDIR, (result >= 0), handle, "%s", path);
 
        return result;
 }
 
-static int smb_full_audit_rmdir(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_rmdir(vfs_handle_struct *handle,
                       const char *path)
 {
        int result;
        
-       result = SMB_VFS_NEXT_RMDIR(handle, conn, path);
+       result = SMB_VFS_NEXT_RMDIR(handle, path);
 
        do_log(SMB_VFS_OP_RMDIR, (result >= 0), handle, "%s", path);
 
        return result;
 }
 
-static int smb_full_audit_closedir(vfs_handle_struct *handle, connection_struct *conn,
-                         DIR *dirp)
+static int smb_full_audit_closedir(vfs_handle_struct *handle,
+                         SMB_STRUCT_DIR *dirp)
 {
        int result;
 
-       result = SMB_VFS_NEXT_CLOSEDIR(handle, conn, dirp);
+       result = SMB_VFS_NEXT_CLOSEDIR(handle, dirp);
        
        do_log(SMB_VFS_OP_CLOSEDIR, (result >= 0), handle, "");
 
        return result;
 }
 
-static int smb_full_audit_open(vfs_handle_struct *handle, connection_struct *conn,
-                     const char *fname, int flags, mode_t mode)
+static int smb_full_audit_open(vfs_handle_struct *handle,
+                     const char *fname, files_struct *fsp, int flags, mode_t mode)
 {
        int result;
        
-       result = SMB_VFS_NEXT_OPEN(handle, conn, fname, flags, mode);
+       result = SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode);
 
        do_log(SMB_VFS_OP_OPEN, (result >= 0), handle, "%s|%s",
               ((flags & O_WRONLY) || (flags & O_RDWR))?"w":"r",
@@ -922,11 +1087,11 @@ static int smb_full_audit_open(vfs_handle_struct *handle, connection_struct *con
        return result;
 }
 
-static int smb_full_audit_close(vfs_handle_struct *handle, files_struct *fsp, int fd)
+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);
 
@@ -934,11 +1099,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);
 
@@ -946,11 +1111,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);
 
@@ -958,11 +1123,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);
 
@@ -970,12 +1135,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);
 
@@ -983,11 +1148,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);
@@ -996,110 +1161,124 @@ 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 *tofsp,
+                             SMB_OFF_T offset,
+                             size_t n)
+{
+       ssize_t result;
+
+       result = SMB_VFS_NEXT_RECVFILE(handle, fromfd, tofsp, offset, n);
+
+       do_log(SMB_VFS_OP_RECVFILE, (result >= 0), handle,
+              "%s", tofsp->fsp_name);
 
        return result;
 }
 
-static int smb_full_audit_rename(vfs_handle_struct *handle, connection_struct *conn,
-                       const char *old, const char *new)
+static int smb_full_audit_rename(vfs_handle_struct *handle,
+                       const char *oldname, const char *newname)
 {
        int result;
        
-       result = SMB_VFS_NEXT_RENAME(handle, conn, old, new);
+       result = SMB_VFS_NEXT_RENAME(handle, oldname, newname);
 
-       do_log(SMB_VFS_OP_RENAME, (result >= 0), handle, "%s|%s", old, new);
+       do_log(SMB_VFS_OP_RENAME, (result >= 0), handle, "%s|%s", oldname, newname);
 
        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);
 
        return result;    
 }
 
-static int smb_full_audit_stat(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_stat(vfs_handle_struct *handle,
                      const char *fname, SMB_STRUCT_STAT *sbuf)
 {
        int result;
        
-       result = SMB_VFS_NEXT_STAT(handle, conn, fname, sbuf);
+       result = SMB_VFS_NEXT_STAT(handle, fname, sbuf);
 
        do_log(SMB_VFS_OP_STAT, (result >= 0), handle, "%s", fname);
 
        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);
 
        return result;
 }
 
-static int smb_full_audit_lstat(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_lstat(vfs_handle_struct *handle,
                       const char *path, SMB_STRUCT_STAT *sbuf)
 {
        int result;
        
-       result = SMB_VFS_NEXT_LSTAT(handle, conn, path, sbuf);
+       result = SMB_VFS_NEXT_LSTAT(handle, path, sbuf);
 
        do_log(SMB_VFS_OP_LSTAT, (result >= 0), handle, "%s", path);
 
        return result;    
 }
 
-static int smb_full_audit_unlink(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_unlink(vfs_handle_struct *handle,
                        const char *path)
 {
        int result;
        
-       result = SMB_VFS_NEXT_UNLINK(handle, conn, path);
+       result = SMB_VFS_NEXT_UNLINK(handle, path);
 
        do_log(SMB_VFS_OP_UNLINK, (result >= 0), handle, "%s", path);
 
        return result;
 }
 
-static int smb_full_audit_chmod(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_chmod(vfs_handle_struct *handle,
                       const char *path, mode_t mode)
 {
        int result;
 
-       result = SMB_VFS_NEXT_CHMOD(handle, conn, path, mode);
+       result = SMB_VFS_NEXT_CHMOD(handle, path, mode);
 
        do_log(SMB_VFS_OP_CHMOD, (result >= 0), handle, "%s|%o", path, mode);
 
        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);
@@ -1107,12 +1286,12 @@ static int smb_full_audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, i
        return result;
 }
 
-static int smb_full_audit_chown(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_chown(vfs_handle_struct *handle,
                       const char *path, uid_t uid, gid_t gid)
 {
        int result;
 
-       result = SMB_VFS_NEXT_CHOWN(handle, conn, path, uid, gid);
+       result = SMB_VFS_NEXT_CHOWN(handle, path, uid, gid);
 
        do_log(SMB_VFS_OP_CHOWN, (result >= 0), handle, "%s|%ld|%ld",
               path, (long int)uid, (long int)gid);
@@ -1120,12 +1299,12 @@ static int smb_full_audit_chown(vfs_handle_struct *handle, connection_struct *co
        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);
@@ -1133,48 +1312,61 @@ static int smb_full_audit_fchown(vfs_handle_struct *handle, files_struct *fsp, i
        return result;
 }
 
-static int smb_full_audit_chdir(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_lchown(vfs_handle_struct *handle,
+                      const char *path, uid_t uid, gid_t gid)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_LCHOWN(handle, path, uid, gid);
+
+       do_log(SMB_VFS_OP_LCHOWN, (result >= 0), handle, "%s|%ld|%ld",
+              path, (long int)uid, (long int)gid);
+
+       return result;
+}
+
+static int smb_full_audit_chdir(vfs_handle_struct *handle,
                       const char *path)
 {
        int result;
 
-       result = SMB_VFS_NEXT_CHDIR(handle, conn, path);
+       result = SMB_VFS_NEXT_CHDIR(handle, path);
 
        do_log(SMB_VFS_OP_CHDIR, (result >= 0), handle, "chdir|%s", path);
 
        return result;
 }
 
-static char *smb_full_audit_getwd(vfs_handle_struct *handle, connection_struct *conn,
+static char *smb_full_audit_getwd(vfs_handle_struct *handle,
                         char *path)
 {
        char *result;
 
-       result = SMB_VFS_NEXT_GETWD(handle, conn, path);
+       result = SMB_VFS_NEXT_GETWD(handle, path);
        
        do_log(SMB_VFS_OP_GETWD, (result != NULL), handle, "%s", path);
 
        return result;
 }
 
-static int smb_full_audit_utime(vfs_handle_struct *handle, connection_struct *conn,
-                      const char *path, struct utimbuf *times)
+static int smb_full_audit_ntimes(vfs_handle_struct *handle,
+                      const char *path, const struct timespec ts[2])
 {
        int result;
 
-       result = SMB_VFS_NEXT_UTIME(handle, conn, path, times);
+       result = SMB_VFS_NEXT_NTIMES(handle, path, ts);
 
-       do_log(SMB_VFS_OP_UTIME, (result >= 0), handle, "%s", path);
+       do_log(SMB_VFS_OP_NTIMES, (result >= 0), handle, "%s", path);
 
        return result;
 }
 
 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);
@@ -1182,24 +1374,63 @@ 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;
+       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 >= 0), handle, "%s", fsp->fsp_name);
+       do_log(SMB_VFS_OP_LOCK, result, handle, "%s", fsp->fsp_name);
 
        return result;
 }
 
-static int smb_full_audit_symlink(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_kernel_flock(struct vfs_handle_struct *handle,
+                                      struct files_struct *fsp,
+                                      uint32 share_mode)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_KERNEL_FLOCK(handle, fsp, share_mode);
+
+       do_log(SMB_VFS_OP_KERNEL_FLOCK, (result >= 0), handle, "%s",
+              fsp->fsp_name);
+
+       return result;
+}
+
+static int smb_full_audit_linux_setlease(vfs_handle_struct *handle, files_struct *fsp,
+                                 int leasetype)
+{
+        int result;
+
+        result = SMB_VFS_NEXT_LINUX_SETLEASE(handle, fsp, leasetype);
+
+        do_log(SMB_VFS_OP_LINUX_SETLEASE, (result >= 0), handle, "%s",
+               fsp->fsp_name);
+
+        return result;
+}
+
+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, poffset, pcount, ptype, ppid);
+
+       do_log(SMB_VFS_OP_GETLOCK, result, handle, "%s", fsp->fsp_name);
+
+       return result;
+}
+
+static int smb_full_audit_symlink(vfs_handle_struct *handle,
                         const char *oldpath, const char *newpath)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYMLINK(handle, conn, oldpath, newpath);
+       result = SMB_VFS_NEXT_SYMLINK(handle, oldpath, newpath);
 
        do_log(SMB_VFS_OP_SYMLINK, (result >= 0), handle,
               "%s|%s", oldpath, newpath);
@@ -1207,24 +1438,24 @@ static int smb_full_audit_symlink(vfs_handle_struct *handle, connection_struct *
        return result;
 }
 
-static int smb_full_audit_readlink(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_readlink(vfs_handle_struct *handle,
                          const char *path, char *buf, size_t bufsiz)
 {
        int result;
 
-       result = SMB_VFS_NEXT_READLINK(handle, conn, path, buf, bufsiz);
+       result = SMB_VFS_NEXT_READLINK(handle, path, buf, bufsiz);
 
        do_log(SMB_VFS_OP_READLINK, (result >= 0), handle, "%s", path);
 
        return result;
 }
 
-static int smb_full_audit_link(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_link(vfs_handle_struct *handle,
                      const char *oldpath, const char *newpath)
 {
        int result;
 
-       result = SMB_VFS_NEXT_LINK(handle, conn, oldpath, newpath);
+       result = SMB_VFS_NEXT_LINK(handle, oldpath, newpath);
 
        do_log(SMB_VFS_OP_LINK, (result >= 0), handle,
               "%s|%s", oldpath, newpath);
@@ -1232,94 +1463,142 @@ static int smb_full_audit_link(vfs_handle_struct *handle, connection_struct *con
        return result;
 }
 
-static int smb_full_audit_mknod(vfs_handle_struct *handle, connection_struct *conn,
+static int smb_full_audit_mknod(vfs_handle_struct *handle,
                       const char *pathname, mode_t mode, SMB_DEV_T dev)
 {
        int result;
 
-       result = SMB_VFS_NEXT_MKNOD(handle, conn, pathname, mode, dev);
+       result = SMB_VFS_NEXT_MKNOD(handle, pathname, mode, dev);
 
        do_log(SMB_VFS_OP_MKNOD, (result >= 0), handle, "%s", pathname);
 
        return result;
 }
 
-static char *smb_full_audit_realpath(vfs_handle_struct *handle, connection_struct *conn,
+static char *smb_full_audit_realpath(vfs_handle_struct *handle,
                            const char *path, char *resolved_path)
 {
        char *result;
 
-       result = SMB_VFS_NEXT_REALPATH(handle, conn, path, resolved_path);
+       result = SMB_VFS_NEXT_REALPATH(handle, path, resolved_path);
 
        do_log(SMB_VFS_OP_REALPATH, (result != NULL), handle, "%s", path);
 
        return result;
 }
 
-static size_t smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                               int fd, uint32 security_info,
-                               SEC_DESC **ppdesc)
+static NTSTATUS smb_full_audit_notify_watch(struct vfs_handle_struct *handle,
+                       struct sys_notify_context *ctx,
+                       struct notify_entry *e,
+                       void (*callback)(struct sys_notify_context *ctx,
+                                       void *private_data,
+                                       struct notify_event *ev),
+                       void *private_data, void *handle_p)
 {
-       size_t result;
+       NTSTATUS result;
 
-       result = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, fd, security_info,
-                                         ppdesc);
+       result = SMB_VFS_NEXT_NOTIFY_WATCH(handle, ctx, e, callback, private_data, handle_p);
 
-       do_log(SMB_VFS_OP_FGET_NT_ACL, (result > 0), handle,
-              "%s", fsp->fsp_name);
+       do_log(SMB_VFS_OP_NOTIFY_WATCH, NT_STATUS_IS_OK(result), handle, "");
 
        return result;
 }
 
-static size_t smb_full_audit_get_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                              const char *name, uint32 security_info,
-                              SEC_DESC **ppdesc)
+static int smb_full_audit_chflags(vfs_handle_struct *handle,
+                           const char *path, unsigned int flags)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_CHFLAGS(handle, path, flags);
+
+       do_log(SMB_VFS_OP_CHFLAGS, (result != 0), handle, "%s", path);
+
+       return result;
+}
+
+static struct file_id smb_full_audit_file_id_create(struct vfs_handle_struct *handle,
+                                                   SMB_DEV_T dev, SMB_INO_T inode)
 {
-       size_t result;
+       struct file_id id_zero;
+       struct file_id result;
+
+       ZERO_STRUCT(id_zero);
+
+       result = SMB_VFS_NEXT_FILE_ID_CREATE(handle, dev, inode);
+
+       do_log(SMB_VFS_OP_FILE_ID_CREATE,
+              !file_id_equal(&id_zero, &result),
+              handle, "%s", file_id_string_tos(&result));
+
+       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);
 
-       result = SMB_VFS_NEXT_GET_NT_ACL(handle, fsp, name, security_info,
-                                        ppdesc);
+       do_log(SMB_VFS_OP_STREAMINFO, NT_STATUS_IS_OK(result), handle,
+              "%s", fname);
 
-       do_log(SMB_VFS_OP_GET_NT_ACL, (result > 0), handle,
+       return result;
+}
+
+static NTSTATUS smb_full_audit_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
+                               uint32 security_info,
+                               SEC_DESC **ppdesc)
+{
+       NTSTATUS result;
+
+       result = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, ppdesc);
+
+       do_log(SMB_VFS_OP_FGET_NT_ACL, NT_STATUS_IS_OK(result), handle,
               "%s", fsp->fsp_name);
 
        return result;
 }
 
-static BOOL smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                             int fd, uint32 security_info_sent,
-                             SEC_DESC *psd)
+static NTSTATUS smb_full_audit_get_nt_acl(vfs_handle_struct *handle,
+                                         const char *name,
+                                         uint32 security_info,
+                                         SEC_DESC **ppdesc)
 {
-       BOOL result;
+       NTSTATUS result;
 
-       result = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, fd, security_info_sent,
-                                         psd);
+       result = SMB_VFS_NEXT_GET_NT_ACL(handle, name, security_info, ppdesc);
 
-       do_log(SMB_VFS_OP_FSET_NT_ACL, result, handle, "%s", fsp->fsp_name);
+       do_log(SMB_VFS_OP_GET_NT_ACL, NT_STATUS_IS_OK(result), handle,
+              "%s", name);
 
        return result;
 }
 
-static BOOL smb_full_audit_set_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
-                            const char *name, uint32 security_info_sent,
-                            SEC_DESC *psd)
+static NTSTATUS smb_full_audit_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
+                             uint32 security_info_sent,
+                             const SEC_DESC *psd)
 {
-       BOOL result;
+       NTSTATUS result;
 
-       result = SMB_VFS_NEXT_SET_NT_ACL(handle, fsp, name, security_info_sent,
-                                        psd);
+       result = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
 
-       do_log(SMB_VFS_OP_SET_NT_ACL, result, handle, "%s", fsp->fsp_name);
+       do_log(SMB_VFS_OP_FSET_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, connection_struct *conn,
+static int smb_full_audit_chmod_acl(vfs_handle_struct *handle,
                           const char *path, mode_t mode)
 {
        int result;
        
-       result = SMB_VFS_NEXT_CHMOD_ACL(handle, conn, path, mode);
+       result = SMB_VFS_NEXT_CHMOD_ACL(handle, path, mode);
 
        do_log(SMB_VFS_OP_CHMOD_ACL, (result >= 0), handle,
               "%s|%o", path, mode);
@@ -1328,11 +1607,11 @@ static int smb_full_audit_chmod_acl(vfs_handle_struct *handle, connection_struct
 }
 
 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);
@@ -1341,13 +1620,13 @@ static int smb_full_audit_fchmod_acl(vfs_handle_struct *handle, files_struct *fs
 }
 
 static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle,
-                                  connection_struct *conn,
+
                                   SMB_ACL_T theacl, int entry_id,
                                   SMB_ACL_ENTRY_T *entry_p)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, conn, theacl, entry_id,
+       result = SMB_VFS_NEXT_SYS_ACL_GET_ENTRY(handle, theacl, entry_id,
                                                entry_p);
 
        do_log(SMB_VFS_OP_SYS_ACL_GET_ENTRY, (result >= 0), handle,
@@ -1357,13 +1636,13 @@ static int smb_full_audit_sys_acl_get_entry(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_get_tag_type(vfs_handle_struct *handle,
-                                     connection_struct *conn,
+
                                      SMB_ACL_ENTRY_T entry_d,
                                      SMB_ACL_TAG_T *tag_type_p)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, conn, entry_d,
+       result = SMB_VFS_NEXT_SYS_ACL_GET_TAG_TYPE(handle, entry_d,
                                                   tag_type_p);
 
        do_log(SMB_VFS_OP_SYS_ACL_GET_TAG_TYPE, (result >= 0), handle,
@@ -1373,13 +1652,13 @@ static int smb_full_audit_sys_acl_get_tag_type(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_get_permset(vfs_handle_struct *handle,
-                                    connection_struct *conn,
+
                                     SMB_ACL_ENTRY_T entry_d,
                                     SMB_ACL_PERMSET_T *permset_p)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, conn, entry_d,
+       result = SMB_VFS_NEXT_SYS_ACL_GET_PERMSET(handle, entry_d,
                                                  permset_p);
 
        do_log(SMB_VFS_OP_SYS_ACL_GET_PERMSET, (result >= 0), handle,
@@ -1389,12 +1668,12 @@ static int smb_full_audit_sys_acl_get_permset(vfs_handle_struct *handle,
 }
 
 static void * smb_full_audit_sys_acl_get_qualifier(vfs_handle_struct *handle,
-                                         connection_struct *conn,
+
                                          SMB_ACL_ENTRY_T entry_d)
 {
        void *result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, conn, entry_d);
+       result = SMB_VFS_NEXT_SYS_ACL_GET_QUALIFIER(handle, entry_d);
 
        do_log(SMB_VFS_OP_SYS_ACL_GET_QUALIFIER, (result != NULL), handle,
               "");
@@ -1403,13 +1682,12 @@ static void * smb_full_audit_sys_acl_get_qualifier(vfs_handle_struct *handle,
 }
 
 static SMB_ACL_T smb_full_audit_sys_acl_get_file(vfs_handle_struct *handle,
-                                       connection_struct *conn,
                                        const char *path_p,
                                        SMB_ACL_TYPE_T type)
 {
        SMB_ACL_T result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, conn, path_p, type);
+       result = SMB_VFS_NEXT_SYS_ACL_GET_FILE(handle, path_p, type);
 
        do_log(SMB_VFS_OP_SYS_ACL_GET_FILE, (result != NULL), handle,
               "%s", path_p);
@@ -1418,11 +1696,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);
@@ -1431,12 +1709,12 @@ static SMB_ACL_T smb_full_audit_sys_acl_get_fd(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle,
-                                    connection_struct *conn,
+
                                     SMB_ACL_PERMSET_T permset)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, conn, permset);
+       result = SMB_VFS_NEXT_SYS_ACL_CLEAR_PERMS(handle, permset);
 
        do_log(SMB_VFS_OP_SYS_ACL_CLEAR_PERMS, (result >= 0), handle,
               "");
@@ -1445,13 +1723,13 @@ static int smb_full_audit_sys_acl_clear_perms(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle,
-                                 connection_struct *conn,
+
                                  SMB_ACL_PERMSET_T permset,
                                  SMB_ACL_PERM_T perm)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, conn, permset, perm);
+       result = SMB_VFS_NEXT_SYS_ACL_ADD_PERM(handle, permset, perm);
 
        do_log(SMB_VFS_OP_SYS_ACL_ADD_PERM, (result >= 0), handle,
               "");
@@ -1460,12 +1738,12 @@ static int smb_full_audit_sys_acl_add_perm(vfs_handle_struct *handle,
 }
 
 static char * smb_full_audit_sys_acl_to_text(vfs_handle_struct *handle,
-                                   connection_struct *conn, SMB_ACL_T theacl,
+                                   SMB_ACL_T theacl,
                                    ssize_t *plen)
 {
        char * result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, conn, theacl, plen);
+       result = SMB_VFS_NEXT_SYS_ACL_TO_TEXT(handle, theacl, plen);
 
        do_log(SMB_VFS_OP_SYS_ACL_TO_TEXT, (result != NULL), handle,
               "");
@@ -1474,12 +1752,12 @@ static char * smb_full_audit_sys_acl_to_text(vfs_handle_struct *handle,
 }
 
 static SMB_ACL_T smb_full_audit_sys_acl_init(vfs_handle_struct *handle,
-                                   connection_struct *conn,
+
                                    int count)
 {
        SMB_ACL_T result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_INIT(handle, conn, count);
+       result = SMB_VFS_NEXT_SYS_ACL_INIT(handle, count);
 
        do_log(SMB_VFS_OP_SYS_ACL_INIT, (result != NULL), handle,
               "");
@@ -1488,12 +1766,12 @@ static SMB_ACL_T smb_full_audit_sys_acl_init(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_create_entry(vfs_handle_struct *handle,
-                                     connection_struct *conn, SMB_ACL_T *pacl,
+                                     SMB_ACL_T *pacl,
                                      SMB_ACL_ENTRY_T *pentry)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, conn, pacl, pentry);
+       result = SMB_VFS_NEXT_SYS_ACL_CREATE_ENTRY(handle, pacl, pentry);
 
        do_log(SMB_VFS_OP_SYS_ACL_CREATE_ENTRY, (result >= 0), handle,
               "");
@@ -1502,13 +1780,13 @@ static int smb_full_audit_sys_acl_create_entry(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_set_tag_type(vfs_handle_struct *handle,
-                                     connection_struct *conn,
+
                                      SMB_ACL_ENTRY_T entry,
                                      SMB_ACL_TAG_T tagtype)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, conn, entry,
+       result = SMB_VFS_NEXT_SYS_ACL_SET_TAG_TYPE(handle, entry,
                                                   tagtype);
 
        do_log(SMB_VFS_OP_SYS_ACL_SET_TAG_TYPE, (result >= 0), handle,
@@ -1518,13 +1796,13 @@ static int smb_full_audit_sys_acl_set_tag_type(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_set_qualifier(vfs_handle_struct *handle,
-                                      connection_struct *conn,
+
                                       SMB_ACL_ENTRY_T entry,
                                       void *qual)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, conn, entry, qual);
+       result = SMB_VFS_NEXT_SYS_ACL_SET_QUALIFIER(handle, entry, qual);
 
        do_log(SMB_VFS_OP_SYS_ACL_SET_QUALIFIER, (result >= 0), handle,
               "");
@@ -1533,13 +1811,13 @@ static int smb_full_audit_sys_acl_set_qualifier(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_set_permset(vfs_handle_struct *handle,
-                                    connection_struct *conn,
+
                                     SMB_ACL_ENTRY_T entry,
                                     SMB_ACL_PERMSET_T permset)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, conn, entry, permset);
+       result = SMB_VFS_NEXT_SYS_ACL_SET_PERMSET(handle, entry, permset);
 
        do_log(SMB_VFS_OP_SYS_ACL_SET_PERMSET, (result >= 0), handle,
               "");
@@ -1548,12 +1826,12 @@ static int smb_full_audit_sys_acl_set_permset(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_valid(vfs_handle_struct *handle,
-                              connection_struct *conn,
+
                               SMB_ACL_T theacl )
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_VALID(handle, conn, theacl);
+       result = SMB_VFS_NEXT_SYS_ACL_VALID(handle, theacl);
 
        do_log(SMB_VFS_OP_SYS_ACL_VALID, (result >= 0), handle,
               "");
@@ -1562,13 +1840,13 @@ static int smb_full_audit_sys_acl_valid(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_set_file(vfs_handle_struct *handle,
-                                 connection_struct *conn,
+
                                  const char *name, SMB_ACL_TYPE_T acltype,
                                  SMB_ACL_T theacl)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, conn, name, acltype,
+       result = SMB_VFS_NEXT_SYS_ACL_SET_FILE(handle, name, acltype,
                                               theacl);
 
        do_log(SMB_VFS_OP_SYS_ACL_SET_FILE, (result >= 0), handle,
@@ -1578,11 +1856,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);
@@ -1591,12 +1869,12 @@ static int smb_full_audit_sys_acl_set_fd(vfs_handle_struct *handle, files_struct
 }
 
 static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle,
-                                        connection_struct *conn,
+
                                         const char *path)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, conn, path);
+       result = SMB_VFS_NEXT_SYS_ACL_DELETE_DEF_FILE(handle, path);
 
        do_log(SMB_VFS_OP_SYS_ACL_DELETE_DEF_FILE, (result >= 0), handle,
               "%s", path);
@@ -1605,13 +1883,13 @@ static int smb_full_audit_sys_acl_delete_def_file(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle,
-                                 connection_struct *conn,
+
                                  SMB_ACL_PERMSET_T permset,
                                  SMB_ACL_PERM_T perm)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, conn, permset, perm);
+       result = SMB_VFS_NEXT_SYS_ACL_GET_PERM(handle, permset, perm);
 
        do_log(SMB_VFS_OP_SYS_ACL_GET_PERM, (result >= 0), handle,
               "");
@@ -1620,12 +1898,12 @@ static int smb_full_audit_sys_acl_get_perm(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_free_text(vfs_handle_struct *handle,
-                                  connection_struct *conn,
+
                                   char *text)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, conn, text);
+       result = SMB_VFS_NEXT_SYS_ACL_FREE_TEXT(handle, text);
 
        do_log(SMB_VFS_OP_SYS_ACL_FREE_TEXT, (result >= 0), handle,
               "");
@@ -1634,12 +1912,12 @@ static int smb_full_audit_sys_acl_free_text(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_free_acl(vfs_handle_struct *handle,
-                                 connection_struct *conn,
+
                                  SMB_ACL_T posix_acl)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, conn, posix_acl);
+       result = SMB_VFS_NEXT_SYS_ACL_FREE_ACL(handle, posix_acl);
 
        do_log(SMB_VFS_OP_SYS_ACL_FREE_ACL, (result >= 0), handle,
               "");
@@ -1648,13 +1926,12 @@ static int smb_full_audit_sys_acl_free_acl(vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_sys_acl_free_qualifier(vfs_handle_struct *handle,
-                                       connection_struct *conn,
                                        void *qualifier,
                                        SMB_ACL_TAG_T tagtype)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, conn, qualifier,
+       result = SMB_VFS_NEXT_SYS_ACL_FREE_QUALIFIER(handle, qualifier,
                                                     tagtype);
 
        do_log(SMB_VFS_OP_SYS_ACL_FREE_QUALIFIER, (result >= 0), handle,
@@ -1664,12 +1941,12 @@ static int smb_full_audit_sys_acl_free_qualifier(vfs_handle_struct *handle,
 }
 
 static ssize_t smb_full_audit_getxattr(struct vfs_handle_struct *handle,
-                             struct connection_struct *conn, const char *path,
+                             const char *path,
                              const char *name, void *value, size_t size)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_GETXATTR(handle, conn, path, name, value, size);
+       result = SMB_VFS_NEXT_GETXATTR(handle, path, name, value, size);
 
        do_log(SMB_VFS_OP_GETXATTR, (result >= 0), handle,
               "%s|%s", path, name);
@@ -1678,13 +1955,12 @@ static ssize_t smb_full_audit_getxattr(struct vfs_handle_struct *handle,
 }
 
 static ssize_t smb_full_audit_lgetxattr(struct vfs_handle_struct *handle,
-                              struct connection_struct *conn,
                               const char *path, const char *name,
                               void *value, size_t size)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_LGETXATTR(handle, conn, path, name, value, size);
+       result = SMB_VFS_NEXT_LGETXATTR(handle, path, name, value, size);
 
        do_log(SMB_VFS_OP_LGETXATTR, (result >= 0), handle,
               "%s|%s", path, name);
@@ -1693,12 +1969,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);
@@ -1707,12 +1983,11 @@ static ssize_t smb_full_audit_fgetxattr(struct vfs_handle_struct *handle,
 }
 
 static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle,
-                              struct connection_struct *conn,
                               const char *path, char *list, size_t size)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_LISTXATTR(handle, conn, path, list, size);
+       result = SMB_VFS_NEXT_LISTXATTR(handle, path, list, size);
 
        do_log(SMB_VFS_OP_LISTXATTR, (result >= 0), handle, "%s", path);
 
@@ -1720,12 +1995,11 @@ static ssize_t smb_full_audit_listxattr(struct vfs_handle_struct *handle,
 }
 
 static ssize_t smb_full_audit_llistxattr(struct vfs_handle_struct *handle,
-                               struct connection_struct *conn,
                                const char *path, char *list, size_t size)
 {
        ssize_t result;
 
-       result = SMB_VFS_NEXT_LLISTXATTR(handle, conn, path, list, size);
+       result = SMB_VFS_NEXT_LLISTXATTR(handle, path, list, size);
 
        do_log(SMB_VFS_OP_LLISTXATTR, (result >= 0), handle, "%s", path);
 
@@ -1733,12 +2007,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);
@@ -1747,12 +2021,12 @@ static ssize_t smb_full_audit_flistxattr(struct vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_removexattr(struct vfs_handle_struct *handle,
-                            struct connection_struct *conn, const char *path,
+                            const char *path,
                             const char *name)
 {
        int result;
 
-       result = SMB_VFS_NEXT_REMOVEXATTR(handle, conn, path, name);
+       result = SMB_VFS_NEXT_REMOVEXATTR(handle, path, name);
 
        do_log(SMB_VFS_OP_REMOVEXATTR, (result >= 0), handle,
               "%s|%s", path, name);
@@ -1761,12 +2035,12 @@ static int smb_full_audit_removexattr(struct vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_lremovexattr(struct vfs_handle_struct *handle,
-                             struct connection_struct *conn, const char *path,
+                             const char *path,
                              const char *name)
 {
        int result;
 
-       result = SMB_VFS_NEXT_LREMOVEXATTR(handle, conn, path, name);
+       result = SMB_VFS_NEXT_LREMOVEXATTR(handle, path, name);
 
        do_log(SMB_VFS_OP_LREMOVEXATTR, (result >= 0), handle,
               "%s|%s", path, name);
@@ -1775,12 +2049,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);
@@ -1789,13 +2063,13 @@ static int smb_full_audit_fremovexattr(struct vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_setxattr(struct vfs_handle_struct *handle,
-                         struct connection_struct *conn, const char *path,
+                         const char *path,
                          const char *name, const void *value, size_t size,
                          int flags)
 {
        int result;
 
-       result = SMB_VFS_NEXT_SETXATTR(handle, conn, path, name, value, size,
+       result = SMB_VFS_NEXT_SETXATTR(handle, path, name, value, size,
                                       flags);
 
        do_log(SMB_VFS_OP_SETXATTR, (result >= 0), handle,
@@ -1805,13 +2079,13 @@ static int smb_full_audit_setxattr(struct vfs_handle_struct *handle,
 }
 
 static int smb_full_audit_lsetxattr(struct vfs_handle_struct *handle,
-                          struct connection_struct *conn, const char *path,
+                          const char *path,
                           const char *name, const void *value, size_t size,
                           int flags)
 {
        int result;
 
-       result = SMB_VFS_NEXT_LSETXATTR(handle, conn, path, name, value, size,
+       result = SMB_VFS_NEXT_LSETXATTR(handle, path, name, value, size,
                                        flags);
 
        do_log(SMB_VFS_OP_LSETXATTR, (result >= 0), handle,
@@ -1821,13 +2095,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);
@@ -1835,6 +2108,85 @@ static int smb_full_audit_fsetxattr(struct vfs_handle_struct *handle,
        return result;
 }
 
+static int smb_full_audit_aio_read(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_AIO_READ(handle, fsp, aiocb);
+       do_log(SMB_VFS_OP_AIO_READ, (result >= 0), handle,
+               "%s", fsp->fsp_name);
+
+       return result;
+}
+
+static int smb_full_audit_aio_write(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_AIO_WRITE(handle, fsp, aiocb);
+       do_log(SMB_VFS_OP_AIO_WRITE, (result >= 0), handle,
+               "%s", fsp->fsp_name);
+
+       return result;
+}
+
+static ssize_t smb_full_audit_aio_return(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_AIO_RETURN(handle, fsp, aiocb);
+       do_log(SMB_VFS_OP_AIO_RETURN, (result >= 0), handle,
+               "%s", fsp->fsp_name);
+
+       return result;
+}
+
+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, aiocb);
+       do_log(SMB_VFS_OP_AIO_CANCEL, (result >= 0), handle,
+               "%s", fsp->fsp_name);
+
+       return result;
+}
+
+static int smb_full_audit_aio_error(struct vfs_handle_struct *handle, struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_AIO_ERROR(handle, fsp, aiocb);
+       do_log(SMB_VFS_OP_AIO_ERROR, (result >= 0), handle,
+               "%s", fsp->fsp_name);
+
+       return result;
+}
+
+static int smb_full_audit_aio_fsync(struct vfs_handle_struct *handle, struct files_struct *fsp, int op, SMB_STRUCT_AIOCB *aiocb)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_AIO_FSYNC(handle, fsp, op, aiocb);
+       do_log(SMB_VFS_OP_AIO_FSYNC, (result >= 0), handle,
+               "%s", fsp->fsp_name);
+
+       return result;
+}
+
+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)
+{
+       int result;
+
+       result = SMB_VFS_NEXT_AIO_SUSPEND(handle, fsp, aiocb, n, ts);
+       do_log(SMB_VFS_OP_AIO_SUSPEND, (result >= 0), handle,
+               "%s", fsp->fsp_name);
+
+       return result;
+}
+
+
+NTSTATUS vfs_full_audit_init(void);
 NTSTATUS vfs_full_audit_init(void)
 {
        NTSTATUS ret = smb_register_vfs(SMB_VFS_INTERFACE_VERSION,
@@ -1855,4 +2207,3 @@ NTSTATUS vfs_full_audit_init(void)
        
        return ret;
 }
-