pyldb: avoid segfault when adding an element with no name
[sfrench/samba-autobuild/.git] / examples / VFS / skel_opaque.c
index a4309d4de6983ee1a58b51ee810fb050ed292339..6510ef30d6f5087183f48ca370b6ebaf3e4073c9 100644 (file)
@@ -22,6 +22,7 @@
  */
 
 #include "../source3/include/includes.h"
+#include "lib/util/tevent_unix.h"
 #include "lib/util/tevent_ntstatus.h"
 
 /* PLEASE,PLEASE READ THE VFS MODULES CHAPTER OF THE 
@@ -44,9 +45,11 @@ static void skel_disconnect(vfs_handle_struct *handle)
        ;
 }
 
-static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path,
-                              uint64_t *bsize,
-                              uint64_t *dfree, uint64_t *dsize)
+static uint64_t skel_disk_free(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               uint64_t *bsize,
+                               uint64_t *dfree,
+                               uint64_t *dsize)
 {
        *bsize = 0;
        *dfree = 0;
@@ -54,9 +57,11 @@ static uint64_t skel_disk_free(vfs_handle_struct *handle, const char *path,
        return 0;
 }
 
-static int skel_get_quota(vfs_handle_struct *handle, const char *path,
-                         enum SMB_QUOTA_TYPE qtype, unid_t id,
-                         SMB_DISK_QUOTA *dq)
+static int skel_get_quota(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               enum SMB_QUOTA_TYPE qtype,
+                               unid_t id,
+                               SMB_DISK_QUOTA *dq)
 {
        errno = ENOSYS;
        return -1;
@@ -79,7 +84,8 @@ static int skel_get_shadow_copy_data(vfs_handle_struct *handle,
 }
 
 static int skel_statvfs(struct vfs_handle_struct *handle,
-                       const char *path, struct vfs_statvfs_struct *statbuf)
+                               const struct smb_filename *smb_fname,
+                               struct vfs_statvfs_struct *statbuf)
 {
        errno = ENOSYS;
        return -1;
@@ -97,8 +103,10 @@ static NTSTATUS skel_get_dfs_referrals(struct vfs_handle_struct *handle,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-static DIR *skel_opendir(vfs_handle_struct *handle, const char *fname,
-                        const char *mask, uint32_t attr)
+static DIR *skel_opendir(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       const char *mask,
+                       uint32_t attr)
 {
        return NULL;
 }
@@ -157,13 +165,16 @@ static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
        ;
 }
 
-static int skel_mkdir(vfs_handle_struct *handle, const char *path, mode_t mode)
+static int skel_mkdir(vfs_handle_struct *handle,
+               const struct smb_filename *smb_fname,
+               mode_t mode)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static int skel_rmdir(vfs_handle_struct *handle, const char *path)
+static int skel_rmdir(vfs_handle_struct *handle,
+               const struct smb_filename *smb_fname)
 {
        errno = ENOSYS;
        return -1;
@@ -175,11 +186,6 @@ static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
        return -1;
 }
 
-static void skel_init_search_op(struct vfs_handle_struct *handle, DIR *dirp)
-{
-       ;
-}
-
 static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
                     files_struct *fsp, int flags, mode_t mode)
 {
@@ -215,13 +221,6 @@ static int skel_close_fn(vfs_handle_struct *handle, files_struct *fsp)
        return -1;
 }
 
-static ssize_t skel_vfs_read(vfs_handle_struct *handle, files_struct *fsp,
-                            void *data, size_t n)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static ssize_t skel_pread(vfs_handle_struct *handle, files_struct *fsp,
                          void *data, size_t n, off_t offset)
 {
@@ -238,16 +237,10 @@ static struct tevent_req *skel_pread_send(struct vfs_handle_struct *handle,
        return NULL;
 }
 
-static ssize_t skel_pread_recv(struct tevent_req *req, int *err)
+static ssize_t skel_pread_recv(struct tevent_req *req,
+                              struct vfs_aio_state *vfs_aio_state)
 {
-       *err = ENOSYS;
-       return -1;
-}
-
-static ssize_t skel_write(vfs_handle_struct *handle, files_struct *fsp,
-                         const void *data, size_t n)
-{
-       errno = ENOSYS;
+       vfs_aio_state->error = ENOSYS;
        return -1;
 }
 
@@ -268,9 +261,10 @@ static struct tevent_req *skel_pwrite_send(struct vfs_handle_struct *handle,
        return NULL;
 }
 
-static ssize_t skel_pwrite_recv(struct tevent_req *req, int *err)
+static ssize_t skel_pwrite_recv(struct tevent_req *req,
+                               struct vfs_aio_state *vfs_aio_state)
 {
-       *err = ENOSYS;
+       vfs_aio_state->error = ENOSYS;
        return -1;
 }
 
@@ -304,12 +298,6 @@ static int skel_rename(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_fsync(vfs_handle_struct *handle, files_struct *fsp)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle,
                                          TALLOC_CTX *mem_ctx,
                                          struct tevent_context *ev,
@@ -318,9 +306,10 @@ static struct tevent_req *skel_fsync_send(struct vfs_handle_struct *handle,
        return NULL;
 }
 
-static int skel_fsync_recv(struct tevent_req *req, int *err)
+static int skel_fsync_recv(struct tevent_req *req,
+                          struct vfs_aio_state *vfs_aio_state)
 {
-       *err = ENOSYS;
+       vfs_aio_state->error = ENOSYS;
        return -1;
 }
 
@@ -359,7 +348,9 @@ static int skel_unlink(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_chmod(vfs_handle_struct *handle, const char *path, mode_t mode)
+static int skel_chmod(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       mode_t mode)
 {
        errno = ENOSYS;
        return -1;
@@ -372,8 +363,10 @@ static int skel_fchmod(vfs_handle_struct *handle, files_struct *fsp,
        return -1;
 }
 
-static int skel_chown(vfs_handle_struct *handle, const char *path,
-                     uid_t uid, gid_t gid)
+static int skel_chown(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       uid_t uid,
+                       gid_t gid)
 {
        errno = ENOSYS;
        return -1;
@@ -386,20 +379,24 @@ static int skel_fchown(vfs_handle_struct *handle, files_struct *fsp,
        return -1;
 }
 
-static int skel_lchown(vfs_handle_struct *handle, const char *path,
-                      uid_t uid, gid_t gid)
+static int skel_lchown(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       uid_t uid,
+                       gid_t gid)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static int skel_chdir(vfs_handle_struct *handle, const char *path)
+static int skel_chdir(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static char *skel_getwd(vfs_handle_struct *handle)
+static struct smb_filename *skel_getwd(vfs_handle_struct *handle,
+                               TALLOC_CTX *ctx)
 {
        errno = ENOSYS;
        return NULL;
@@ -457,41 +454,50 @@ static bool skel_getlock(vfs_handle_struct *handle, files_struct *fsp,
        return false;
 }
 
-static int skel_symlink(vfs_handle_struct *handle, const char *oldpath,
-                       const char *newpath)
+static int skel_symlink(vfs_handle_struct *handle,
+                       const char *link_contents,
+                       const struct smb_filename *new_smb_fname)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static int skel_vfs_readlink(vfs_handle_struct *handle, const char *path,
-                            char *buf, size_t bufsiz)
+static int skel_vfs_readlink(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       char *buf,
+                       size_t bufsiz)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static int skel_link(vfs_handle_struct *handle, const char *oldpath,
-                    const char *newpath)
+static int skel_link(vfs_handle_struct *handle,
+                       const struct smb_filename *old_smb_fname,
+                       const struct smb_filename *new_smb_fname)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static int skel_mknod(vfs_handle_struct *handle, const char *path, mode_t mode,
-                     SMB_DEV_T dev)
+static int skel_mknod(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       mode_t mode,
+                       SMB_DEV_T dev)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static char *skel_realpath(vfs_handle_struct *handle, const char *path)
+static struct smb_filename *skel_realpath(vfs_handle_struct *handle,
+                       TALLOC_CTX *ctx,
+                       const struct smb_filename *smb_fname)
 {
        errno = ENOSYS;
        return NULL;
 }
 
-static int skel_chflags(vfs_handle_struct *handle, const char *path,
+static int skel_chflags(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
                        uint flags)
 {
        errno = ENOSYS;
@@ -507,14 +513,57 @@ static struct file_id skel_file_id_create(vfs_handle_struct *handle,
        return id;
 }
 
+struct skel_offload_read_state {
+       bool dummy;
+};
+
+static struct tevent_req *skel_offload_read_send(
+       TALLOC_CTX *mem_ctx,
+       struct tevent_context *ev,
+       struct vfs_handle_struct *handle,
+       struct files_struct *fsp,
+       uint32_t fsctl,
+       uint32_t ttl,
+       off_t offset,
+       size_t to_copy)
+{
+       struct tevent_req *req = NULL;
+       struct skel_offload_read_state *state = NULL;
+
+       req = tevent_req_create(mem_ctx, &state, struct skel_offload_read_state);
+       if (req == NULL) {
+               return NULL;
+       }
+
+       tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
+       return tevent_req_post(req, ev);
+}
+
+static NTSTATUS skel_offload_read_recv(struct tevent_req *req,
+                                      struct vfs_handle_struct *handle,
+                                      TALLOC_CTX *mem_ctx,
+                                      DATA_BLOB *_token_blob)
+{
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+       tevent_req_received(req);
+
+       return NT_STATUS_OK;
+}
+
 struct skel_cc_state {
        uint64_t unused;
 };
-static struct tevent_req *skel_copy_chunk_send(struct vfs_handle_struct *handle,
+static struct tevent_req *skel_offload_write_send(struct vfs_handle_struct *handle,
                                               TALLOC_CTX *mem_ctx,
                                               struct tevent_context *ev,
-                                              struct files_struct *src_fsp,
-                                              off_t src_off,
+                                              uint32_t fsctl,
+                                              DATA_BLOB *token,
+                                              off_t transfer_offset,
                                               struct files_struct *dest_fsp,
                                               off_t dest_off,
                                               off_t num)
@@ -531,7 +580,7 @@ static struct tevent_req *skel_copy_chunk_send(struct vfs_handle_struct *handle,
        return tevent_req_post(req, ev);
 }
 
-static NTSTATUS skel_copy_chunk_recv(struct vfs_handle_struct *handle,
+static NTSTATUS skel_offload_write_recv(struct vfs_handle_struct *handle,
                                     struct tevent_req *req,
                                     off_t *copied)
 {
@@ -565,7 +614,7 @@ static NTSTATUS skel_set_compression(struct vfs_handle_struct *handle,
 
 static NTSTATUS skel_streaminfo(struct vfs_handle_struct *handle,
                                struct files_struct *fsp,
-                               const char *fname,
+                               const struct smb_filename *smb_fname,
                                TALLOC_CTX *mem_ctx,
                                unsigned int *num_streams,
                                struct stream_struct **streams)
@@ -583,7 +632,7 @@ static int skel_get_real_filename(struct vfs_handle_struct *handle,
 }
 
 static const char *skel_connectpath(struct vfs_handle_struct *handle,
-                                   const char *filename)
+                               const struct smb_filename *smb_fname)
 {
        errno = ENOSYS;
        return NULL;
@@ -614,21 +663,14 @@ static bool skel_brl_cancel_windows(struct vfs_handle_struct *handle,
        return false;
 }
 
-static bool skel_strict_lock(struct vfs_handle_struct *handle,
-                            struct files_struct *fsp,
-                            struct lock_struct *plock)
+static bool skel_strict_lock_check(struct vfs_handle_struct *handle,
+                                  struct files_struct *fsp,
+                                  struct lock_struct *plock)
 {
        errno = ENOSYS;
        return false;
 }
 
-static void skel_strict_unlock(struct vfs_handle_struct *handle,
-                              struct files_struct *fsp,
-                              struct lock_struct *plock)
-{
-       ;
-}
-
 static NTSTATUS skel_translate_name(struct vfs_handle_struct *handle,
                                    const char *mapped_name,
                                    enum vfs_translate_direction direction,
@@ -658,6 +700,79 @@ static NTSTATUS skel_readdir_attr(struct vfs_handle_struct *handle,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
+static NTSTATUS skel_get_dos_attributes(struct vfs_handle_struct *handle,
+                               struct smb_filename *smb_fname,
+                               uint32_t *dosmode)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+struct skel_get_dos_attributes_state {
+       struct vfs_aio_state aio_state;
+       uint32_t dosmode;
+};
+
+static struct tevent_req *skel_get_dos_attributes_send(
+                       TALLOC_CTX *mem_ctx,
+                       struct tevent_context *ev,
+                       struct vfs_handle_struct *handle,
+                       files_struct *dir_fsp,
+                       struct smb_filename *smb_fname)
+{
+       struct tevent_req *req = NULL;
+       struct skel_get_dos_attributes_state *state = NULL;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct skel_get_dos_attributes_state);
+       if (req == NULL) {
+               return NULL;
+       }
+
+       tevent_req_nterror(req, NT_STATUS_NOT_IMPLEMENTED);
+       return tevent_req_post(req, ev);
+}
+
+static NTSTATUS skel_get_dos_attributes_recv(struct tevent_req *req,
+                                            struct vfs_aio_state *aio_state,
+                                            uint32_t *dosmode)
+{
+       struct skel_get_dos_attributes_state *state =
+               tevent_req_data(req,
+               struct skel_get_dos_attributes_state);
+       NTSTATUS status;
+
+       if (tevent_req_is_nterror(req, &status)) {
+               tevent_req_received(req);
+               return status;
+       }
+
+       *aio_state = state->aio_state;
+       *dosmode = state->dosmode;
+       tevent_req_received(req);
+       return NT_STATUS_OK;
+}
+
+static NTSTATUS skel_fget_dos_attributes(struct vfs_handle_struct *handle,
+                               struct files_struct *fsp,
+                               uint32_t *dosmode)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS skel_set_dos_attributes(struct vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               uint32_t dosmode)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS skel_fset_dos_attributes(struct vfs_handle_struct *handle,
+                               struct files_struct *fsp,
+                               uint32_t dosmode)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+
 static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
                                 uint32_t security_info,
                                 TALLOC_CTX *mem_ctx,
@@ -667,7 +782,8 @@ static NTSTATUS skel_fget_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 static NTSTATUS skel_get_nt_acl(vfs_handle_struct *handle,
-                               const char *name, uint32_t security_info,
+                               const struct smb_filename *smb_fname,
+                               uint32_t security_info,
                                TALLOC_CTX *mem_ctx,
                                struct security_descriptor **ppdesc)
 {
@@ -681,22 +797,8 @@ static NTSTATUS skel_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-static int skel_chmod_acl(vfs_handle_struct *handle, const char *name,
-                         mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
-static int skel_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp,
-                          mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static SMB_ACL_T skel_sys_acl_get_file(vfs_handle_struct *handle,
-                                      const char *path_p,
+                                      const struct smb_filename *smb_fname,
                                       SMB_ACL_TYPE_T type,
                                       TALLOC_CTX *mem_ctx)
 {
@@ -712,8 +814,10 @@ static SMB_ACL_T skel_sys_acl_get_fd(vfs_handle_struct *handle,
 }
 
 static int skel_sys_acl_blob_get_file(vfs_handle_struct *handle,
-                                     const char *path_p, TALLOC_CTX *mem_ctx,
-                                     char **blob_description, DATA_BLOB *blob)
+                               const struct smb_filename *smb_fname,
+                               TALLOC_CTX *mem_ctx,
+                               char **blob_description,
+                               DATA_BLOB *blob)
 {
        errno = ENOSYS;
        return -1;
@@ -727,8 +831,10 @@ static int skel_sys_acl_blob_get_fd(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_sys_acl_set_file(vfs_handle_struct *handle, const char *name,
-                                SMB_ACL_TYPE_T acltype, SMB_ACL_T theacl)
+static int skel_sys_acl_set_file(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               SMB_ACL_TYPE_T acltype,
+                               SMB_ACL_T theacl)
 {
        errno = ENOSYS;
        return -1;
@@ -742,19 +848,74 @@ static int skel_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp,
 }
 
 static int skel_sys_acl_delete_def_file(vfs_handle_struct *handle,
-                                       const char *path)
+                                       const struct smb_filename *smb_fname)
 {
        errno = ENOSYS;
        return -1;
 }
 
-static ssize_t skel_getxattr(vfs_handle_struct *handle, const char *path,
-                            const char *name, void *value, size_t size)
+static ssize_t skel_getxattr(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               const char *name,
+                               void *value,
+                               size_t size)
 {
        errno = ENOSYS;
        return -1;
 }
 
+struct skel_getxattrat_state {
+       struct vfs_aio_state aio_state;
+       ssize_t xattr_size;
+       uint8_t *xattr_value;
+};
+
+static struct tevent_req *skel_getxattrat_send(
+                       TALLOC_CTX *mem_ctx,
+                       struct tevent_context *ev,
+                       struct vfs_handle_struct *handle,
+                       files_struct *dir_fsp,
+                       const struct smb_filename *smb_fname,
+                       const char *xattr_name,
+                       size_t alloc_hint)
+{
+       struct tevent_req *req = NULL;
+       struct skel_getxattrat_state *state = NULL;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct skel_getxattrat_state);
+       if (req == NULL) {
+               return NULL;
+       }
+
+       tevent_req_error(req, ENOSYS);
+       return tevent_req_post(req, ev);
+}
+
+static ssize_t skel_getxattrat_recv(struct tevent_req *req,
+                                   struct vfs_aio_state *aio_state,
+                                   TALLOC_CTX *mem_ctx,
+                                   uint8_t **xattr_value)
+{
+       struct skel_getxattrat_state *state = tevent_req_data(
+               req, struct skel_getxattrat_state);
+       ssize_t xattr_size;
+
+       if (tevent_req_is_unix_error(req, &aio_state->error)) {
+               tevent_req_received(req);
+               return -1;
+       }
+
+       *aio_state = state->aio_state;
+       xattr_size = state->xattr_size;
+       if (xattr_value != NULL) {
+               *xattr_value = talloc_move(mem_ctx, &state->xattr_value);
+       }
+
+       tevent_req_received(req);
+       return xattr_size;
+}
+
 static ssize_t skel_fgetxattr(vfs_handle_struct *handle,
                              struct files_struct *fsp, const char *name,
                              void *value, size_t size)
@@ -763,8 +924,10 @@ static ssize_t skel_fgetxattr(vfs_handle_struct *handle,
        return -1;
 }
 
-static ssize_t skel_listxattr(vfs_handle_struct *handle, const char *path,
-                             char *list, size_t size)
+static ssize_t skel_listxattr(vfs_handle_struct *handle,
+                               const struct smb_filename *smb_fname,
+                               char *list,
+                               size_t size)
 {
        errno = ENOSYS;
        return -1;
@@ -778,8 +941,9 @@ static ssize_t skel_flistxattr(vfs_handle_struct *handle,
        return -1;
 }
 
-static int skel_removexattr(vfs_handle_struct *handle, const char *path,
-                           const char *name)
+static int skel_removexattr(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       const char *name)
 {
        errno = ENOSYS;
        return -1;
@@ -790,12 +954,14 @@ static int skel_fremovexattr(vfs_handle_struct *handle,
 {
        errno = ENOSYS;
        return -1;
-       return SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
 }
 
-static int skel_setxattr(vfs_handle_struct *handle, const char *path,
-                        const char *name, const void *value, size_t size,
-                        int flags)
+static int skel_setxattr(vfs_handle_struct *handle,
+                       const struct smb_filename *smb_fname,
+                       const char *name,
+                       const void *value,
+                       size_t size,
+                       int flags)
 {
        errno = ENOSYS;
        return -1;
@@ -816,24 +982,46 @@ static bool skel_aio_force(struct vfs_handle_struct *handle,
        return false;
 }
 
-static bool skel_is_offline(struct vfs_handle_struct *handle,
-                           const struct smb_filename *fname,
-                           SMB_STRUCT_STAT *sbuf)
+static NTSTATUS skel_audit_file(struct vfs_handle_struct *handle,
+                               struct smb_filename *file,
+                               struct security_acl *sacl,
+                               uint32_t access_requested,
+                               uint32_t access_denied)
 {
-       errno = ENOSYS;
-       return false;
+       return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-static int skel_set_offline(struct vfs_handle_struct *handle,
-                           const struct smb_filename *fname)
+static NTSTATUS skel_durable_cookie(struct vfs_handle_struct *handle,
+                                   struct files_struct *fsp,
+                                   TALLOC_CTX *mem_ctx,
+                                   DATA_BLOB *cookie)
 {
-       errno = ENOSYS;
-       return -1;
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS skel_durable_disconnect(struct vfs_handle_struct *handle,
+                                       struct files_struct *fsp,
+                                       const DATA_BLOB old_cookie,
+                                       TALLOC_CTX *mem_ctx,
+                                       DATA_BLOB *new_cookie)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
+}
+
+static NTSTATUS skel_durable_reconnect(struct vfs_handle_struct *handle,
+                                      struct smb_request *smb1req,
+                                      struct smbXsrv_open *op,
+                                      const DATA_BLOB old_cookie,
+                                      TALLOC_CTX *mem_ctx,
+                                      struct files_struct **fsp,
+                                      DATA_BLOB *new_cookie)
+{
+       return NT_STATUS_NOT_IMPLEMENTED;
 }
 
 /* VFS operations structure */
 
-struct vfs_fn_pointers skel_opaque_fns = {
+static struct vfs_fn_pointers skel_opaque_fns = {
        /* Disk operations */
 
        .connect_fn = skel_connect,
@@ -860,18 +1048,15 @@ struct vfs_fn_pointers skel_opaque_fns = {
        .mkdir_fn = skel_mkdir,
        .rmdir_fn = skel_rmdir,
        .closedir_fn = skel_closedir,
-       .init_search_op_fn = skel_init_search_op,
 
        /* File operations */
 
        .open_fn = skel_open,
        .create_file_fn = skel_create_file,
        .close_fn = skel_close_fn,
-       .read_fn = skel_vfs_read,
        .pread_fn = skel_pread,
        .pread_send_fn = skel_pread_send,
        .pread_recv_fn = skel_pread_recv,
-       .write_fn = skel_write,
        .pwrite_fn = skel_pwrite,
        .pwrite_send_fn = skel_pwrite_send,
        .pwrite_recv_fn = skel_pwrite_recv,
@@ -879,7 +1064,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
        .sendfile_fn = skel_sendfile,
        .recvfile_fn = skel_recvfile,
        .rename_fn = skel_rename,
-       .fsync_fn = skel_fsync,
        .fsync_send_fn = skel_fsync_send,
        .fsync_recv_fn = skel_fsync_recv,
        .stat_fn = skel_stat,
@@ -908,8 +1092,10 @@ struct vfs_fn_pointers skel_opaque_fns = {
        .realpath_fn = skel_realpath,
        .chflags_fn = skel_chflags,
        .file_id_create_fn = skel_file_id_create,
-       .copy_chunk_send_fn = skel_copy_chunk_send,
-       .copy_chunk_recv_fn = skel_copy_chunk_recv,
+       .offload_read_send_fn = skel_offload_read_send,
+       .offload_read_recv_fn = skel_offload_read_recv,
+       .offload_write_send_fn = skel_offload_write_send,
+       .offload_write_recv_fn = skel_offload_write_recv,
        .get_compression_fn = skel_get_compression,
        .set_compression_fn = skel_set_compression,
 
@@ -919,11 +1105,19 @@ struct vfs_fn_pointers skel_opaque_fns = {
        .brl_lock_windows_fn = skel_brl_lock_windows,
        .brl_unlock_windows_fn = skel_brl_unlock_windows,
        .brl_cancel_windows_fn = skel_brl_cancel_windows,
-       .strict_lock_fn = skel_strict_lock,
-       .strict_unlock_fn = skel_strict_unlock,
+       .strict_lock_check_fn = skel_strict_lock_check,
        .translate_name_fn = skel_translate_name,
        .fsctl_fn = skel_fsctl,
        .readdir_attr_fn = skel_readdir_attr,
+       .audit_file_fn = skel_audit_file,
+
+       /* DOS attributes. */
+       .get_dos_attributes_fn = skel_get_dos_attributes,
+       .get_dos_attributes_send_fn = skel_get_dos_attributes_send,
+       .get_dos_attributes_recv_fn = skel_get_dos_attributes_recv,
+       .fget_dos_attributes_fn = skel_fget_dos_attributes,
+       .set_dos_attributes_fn = skel_set_dos_attributes,
+       .fset_dos_attributes_fn = skel_fset_dos_attributes,
 
        /* NT ACL operations. */
 
@@ -933,9 +1127,6 @@ struct vfs_fn_pointers skel_opaque_fns = {
 
        /* POSIX ACL operations. */
 
-       .chmod_acl_fn = skel_chmod_acl,
-       .fchmod_acl_fn = skel_fchmod_acl,
-
        .sys_acl_get_file_fn = skel_sys_acl_get_file,
        .sys_acl_get_fd_fn = skel_sys_acl_get_fd,
        .sys_acl_blob_get_file_fn = skel_sys_acl_blob_get_file,
@@ -946,6 +1137,8 @@ struct vfs_fn_pointers skel_opaque_fns = {
 
        /* EA operations. */
        .getxattr_fn = skel_getxattr,
+       .getxattrat_send_fn = skel_getxattrat_send,
+       .getxattrat_recv_fn = skel_getxattrat_recv,
        .fgetxattr_fn = skel_fgetxattr,
        .listxattr_fn = skel_listxattr,
        .flistxattr_fn = skel_flistxattr,
@@ -957,14 +1150,22 @@ struct vfs_fn_pointers skel_opaque_fns = {
        /* aio operations */
        .aio_force_fn = skel_aio_force,
 
-       /* offline operations */
-       .is_offline_fn = skel_is_offline,
-       .set_offline_fn = skel_set_offline
+       /* durable handle operations */
+       .durable_cookie_fn = skel_durable_cookie,
+       .durable_disconnect_fn = skel_durable_disconnect,
+       .durable_reconnect_fn = skel_durable_reconnect,
 };
 
 static_decl_vfs;
-NTSTATUS vfs_skel_opaque_init(void)
-{
+NTSTATUS vfs_skel_opaque_init(TALLOC_CTX *ctx)
+{
+       /*
+        * smb_vfs_assert_all_fns() makes sure every
+        * call is implemented.
+        *
+        * An opaque module requires this!
+        */
+       smb_vfs_assert_all_fns(&skel_opaque_fns, "skel_opaque");
        return smb_register_vfs(SMB_VFS_INTERFACE_VERSION, "skel_opaque",
                                &skel_opaque_fns);
 }