smbd: Add mem_ctx to {f,}get_nt_acl VFS call
[sfrench/samba-autobuild/.git] / source3 / smbd / vfs.c
index 2be6c54a8812c52ffad854b9f21eeb3a31de7843..3a95c588c557c56740f8d59c8d6660f1a8fdd5c6 100644 (file)
 #include "memcache.h"
 #include "transfer_file.h"
 #include "ntioctl.h"
+#include "lib/util/tevent_unix.h"
 
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
 
 static_decl_vfs;
 
+struct vfs_fsp_data {
+    struct vfs_fsp_data *next;
+    struct vfs_handle_struct *owner;
+    void (*destroy)(void *p_data);
+    void *_dummy_;
+    /* NOTE: This structure contains four pointers so that we can guarantee
+     * that the end of the structure is always both 4-byte and 8-byte aligned.
+     */
+};
+
 struct vfs_init_function_entry {
        char *name;
        struct vfs_init_function_entry *prev, *next;
@@ -261,6 +272,23 @@ void vfs_remove_fsp_extension(vfs_handle_struct *handle, files_struct *fsp)
        }
 }
 
+void vfs_remove_all_fsp_extensions(files_struct *fsp)
+{
+       struct vfs_fsp_data *curr;
+       struct vfs_fsp_data *next;
+
+       for (curr = fsp->vfs_extension; curr; curr = next) {
+
+               next = curr->next;
+               fsp->vfs_extension = next;
+
+               if (curr->destroy) {
+                       curr->destroy(EXT_DATA_AREA(curr));
+               }
+               TALLOC_FREE(curr);
+       }
+}
+
 void *vfs_memctx_fsp_extension(vfs_handle_struct *handle, files_struct *fsp)
 {
        struct vfs_fsp_data *head;
@@ -300,6 +328,12 @@ bool smbd_vfs_init(connection_struct *conn)
 
        /* Normal share - initialise with disk access functions */
        vfs_init_default(conn);
+
+       /* No need to load vfs modules for printer connections */
+       if (conn->printer) {
+               return True;
+       }
+
        vfs_objects = lp_vfs_objects(SNUM(conn));
 
        /* Override VFS functions if 'vfs object' was not specified*/
@@ -765,26 +799,34 @@ const char *vfs_readdirname(connection_struct *conn, void *p,
 
 int vfs_ChDir(connection_struct *conn, const char *path)
 {
-       int res;
+       int ret;
 
        if (!LastDir) {
                LastDir = SMB_STRDUP("");
        }
 
-       if (strcsequal(path,"."))
-               return(0);
+       if (strcsequal(path,".")) {
+               return 0;
+       }
 
-       if (*path == '/' && strcsequal(LastDir,path))
-               return(0);
+       if (*path == '/' && strcsequal(LastDir,path)) {
+               return 0;
+       }
 
        DEBUG(4,("vfs_ChDir to %s\n",path));
 
-       res = SMB_VFS_CHDIR(conn,path);
-       if (!res) {
+       ret = SMB_VFS_CHDIR(conn,path);
+       if (ret == 0) {
+               /* Global cache. */
                SAFE_FREE(LastDir);
                LastDir = SMB_STRDUP(path);
+
+               /* conn cache. */
+               TALLOC_FREE(conn->cwd);
+               conn->cwd = vfs_GetWd(conn, conn);
+               DEBUG(4,("vfs_ChDir got %s\n",conn->cwd));
        }
-       return(res);
+       return ret;
 }
 
 /*******************************************************************
@@ -1058,6 +1100,7 @@ NTSTATUS check_reduced_name_with_privilege(connection_struct *conn,
        if (!NT_STATUS_IS_OK(status)) {
                TALLOC_FREE(priv_paths);
        }
+       TALLOC_FREE(dir_name);
        return status;
 }
 
@@ -1191,8 +1234,8 @@ NTSTATUS check_reduced_name(connection_struct *conn, const char *fname)
                        p++;
                        if (strcmp(fname, p)!=0) {
                                DEBUG(2, ("check_reduced_name: Bad access "
-                                       "attempt: %s is a symlink\n",
-                                       fname));
+                                       "attempt: %s is a symlink to %s\n",
+                                         fname, p));
                                SAFE_FREE(resolved_name);
                                return NT_STATUS_ACCESS_DENIED;
                        }
@@ -1513,6 +1556,70 @@ ssize_t smb_vfs_call_pread(struct vfs_handle_struct *handle,
        return handle->fns->pread_fn(handle, fsp, data, n, offset);
 }
 
+struct smb_vfs_call_pread_state {
+       ssize_t (*recv_fn)(struct tevent_req *req, int *err);
+       ssize_t retval;
+};
+
+static void smb_vfs_call_pread_done(struct tevent_req *subreq);
+
+struct tevent_req *smb_vfs_call_pread_send(struct vfs_handle_struct *handle,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct files_struct *fsp,
+                                          void *data,
+                                          size_t n, off_t offset)
+{
+       struct tevent_req *req, *subreq;
+       struct smb_vfs_call_pread_state *state;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct smb_vfs_call_pread_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       VFS_FIND(pread_send);
+       state->recv_fn = handle->fns->pread_recv_fn;
+
+       subreq = handle->fns->pread_send_fn(handle, state, ev, fsp, data, n,
+                                           offset);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, smb_vfs_call_pread_done, req);
+       return req;
+}
+
+static void smb_vfs_call_pread_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct smb_vfs_call_pread_state *state = tevent_req_data(
+               req, struct smb_vfs_call_pread_state);
+       int err;
+
+       state->retval = state->recv_fn(subreq, &err);
+       TALLOC_FREE(subreq);
+       if (state->retval == -1) {
+               tevent_req_error(req, err);
+               return;
+       }
+       tevent_req_done(req);
+}
+
+ssize_t SMB_VFS_PREAD_RECV(struct tevent_req *req, int *perrno)
+{
+       struct smb_vfs_call_pread_state *state = tevent_req_data(
+               req, struct smb_vfs_call_pread_state);
+       int err;
+
+       if (tevent_req_is_unix_error(req, &err)) {
+               *perrno = err;
+               return -1;
+       }
+       return state->retval;
+}
+
 ssize_t smb_vfs_call_write(struct vfs_handle_struct *handle,
                           struct files_struct *fsp, const void *data,
                           size_t n)
@@ -1529,6 +1636,70 @@ ssize_t smb_vfs_call_pwrite(struct vfs_handle_struct *handle,
        return handle->fns->pwrite_fn(handle, fsp, data, n, offset);
 }
 
+struct smb_vfs_call_pwrite_state {
+       ssize_t (*recv_fn)(struct tevent_req *req, int *err);
+       ssize_t retval;
+};
+
+static void smb_vfs_call_pwrite_done(struct tevent_req *subreq);
+
+struct tevent_req *smb_vfs_call_pwrite_send(struct vfs_handle_struct *handle,
+                                           TALLOC_CTX *mem_ctx,
+                                           struct tevent_context *ev,
+                                           struct files_struct *fsp,
+                                           const void *data,
+                                           size_t n, off_t offset)
+{
+       struct tevent_req *req, *subreq;
+       struct smb_vfs_call_pwrite_state *state;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct smb_vfs_call_pwrite_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       VFS_FIND(pwrite_send);
+       state->recv_fn = handle->fns->pwrite_recv_fn;
+
+       subreq = handle->fns->pwrite_send_fn(handle, state, ev, fsp, data, n,
+                                            offset);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, smb_vfs_call_pwrite_done, req);
+       return req;
+}
+
+static void smb_vfs_call_pwrite_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct smb_vfs_call_pwrite_state *state = tevent_req_data(
+               req, struct smb_vfs_call_pwrite_state);
+       int err;
+
+       state->retval = state->recv_fn(subreq, &err);
+       TALLOC_FREE(subreq);
+       if (state->retval == -1) {
+               tevent_req_error(req, err);
+               return;
+       }
+       tevent_req_done(req);
+}
+
+ssize_t SMB_VFS_PWRITE_RECV(struct tevent_req *req, int *perrno)
+{
+       struct smb_vfs_call_pwrite_state *state = tevent_req_data(
+               req, struct smb_vfs_call_pwrite_state);
+       int err;
+
+       if (tevent_req_is_unix_error(req, &err)) {
+               *perrno = err;
+               return -1;
+       }
+       return state->retval;
+}
+
 off_t smb_vfs_call_lseek(struct vfs_handle_struct *handle,
                             struct files_struct *fsp, off_t offset,
                             int whence)
@@ -1569,6 +1740,68 @@ int smb_vfs_call_fsync(struct vfs_handle_struct *handle,
        return handle->fns->fsync_fn(handle, fsp);
 }
 
+struct smb_vfs_call_fsync_state {
+       int (*recv_fn)(struct tevent_req *req, int *err);
+       int retval;
+};
+
+static void smb_vfs_call_fsync_done(struct tevent_req *subreq);
+
+struct tevent_req *smb_vfs_call_fsync_send(struct vfs_handle_struct *handle,
+                                          TALLOC_CTX *mem_ctx,
+                                          struct tevent_context *ev,
+                                          struct files_struct *fsp)
+{
+       struct tevent_req *req, *subreq;
+       struct smb_vfs_call_fsync_state *state;
+
+       req = tevent_req_create(mem_ctx, &state,
+                               struct smb_vfs_call_fsync_state);
+       if (req == NULL) {
+               return NULL;
+       }
+       VFS_FIND(fsync_send);
+       state->recv_fn = handle->fns->fsync_recv_fn;
+
+       subreq = handle->fns->fsync_send_fn(handle, state, ev, fsp);
+       if (tevent_req_nomem(subreq, req)) {
+               return tevent_req_post(req, ev);
+       }
+       tevent_req_set_callback(subreq, smb_vfs_call_fsync_done, req);
+       return req;
+}
+
+static void smb_vfs_call_fsync_done(struct tevent_req *subreq)
+{
+       struct tevent_req *req = tevent_req_callback_data(
+               subreq, struct tevent_req);
+       struct smb_vfs_call_fsync_state *state = tevent_req_data(
+               req, struct smb_vfs_call_fsync_state);
+       int err;
+
+       state->retval = state->recv_fn(subreq, &err);
+       TALLOC_FREE(subreq);
+       if (state->retval == -1) {
+               tevent_req_error(req, err);
+               return;
+       }
+       tevent_req_done(req);
+}
+
+int SMB_VFS_FSYNC_RECV(struct tevent_req *req, int *perrno)
+{
+       struct smb_vfs_call_fsync_state *state = tevent_req_data(
+               req, struct smb_vfs_call_fsync_state);
+       int err;
+
+       if (tevent_req_is_unix_error(req, &err)) {
+               *perrno = err;
+               return -1;
+       }
+       return state->retval;
+}
+
+
 int smb_vfs_call_stat(struct vfs_handle_struct *handle,
                      struct smb_filename *smb_fname)
 {
@@ -1932,20 +2165,22 @@ NTSTATUS smb_vfs_call_fsctl(struct vfs_handle_struct *handle,
 NTSTATUS smb_vfs_call_fget_nt_acl(struct vfs_handle_struct *handle,
                                  struct files_struct *fsp,
                                  uint32 security_info,
+                                 TALLOC_CTX *mem_ctx,
                                  struct security_descriptor **ppdesc)
 {
        VFS_FIND(fget_nt_acl);
        return handle->fns->fget_nt_acl_fn(handle, fsp, security_info,
-                                          ppdesc);
+                                          mem_ctx, ppdesc);
 }
 
 NTSTATUS smb_vfs_call_get_nt_acl(struct vfs_handle_struct *handle,
                                 const char *name,
                                 uint32 security_info,
+                                TALLOC_CTX *mem_ctx,
                                 struct security_descriptor **ppdesc)
 {
        VFS_FIND(get_nt_acl);
-       return handle->fns->get_nt_acl_fn(handle, name, security_info, ppdesc);
+       return handle->fns->get_nt_acl_fn(handle, name, security_info, mem_ctx, ppdesc);
 }
 
 NTSTATUS smb_vfs_call_fset_nt_acl(struct vfs_handle_struct *handle,
@@ -1986,118 +2221,42 @@ int smb_vfs_call_fchmod_acl(struct vfs_handle_struct *handle,
        return handle->fns->fchmod_acl_fn(handle, fsp, mode);
 }
 
-int smb_vfs_call_sys_acl_get_entry(struct vfs_handle_struct *handle,
-                                  SMB_ACL_T theacl, int entry_id,
-                                  SMB_ACL_ENTRY_T *entry_p)
-{
-       VFS_FIND(sys_acl_get_entry);
-       return handle->fns->sys_acl_get_entry_fn(handle, theacl, entry_id,
-                                                entry_p);
-}
-
-int smb_vfs_call_sys_acl_get_tag_type(struct vfs_handle_struct *handle,
-                                     SMB_ACL_ENTRY_T entry_d,
-                                     SMB_ACL_TAG_T *tag_type_p)
-{
-       VFS_FIND(sys_acl_get_tag_type);
-       return handle->fns->sys_acl_get_tag_type_fn(handle, entry_d, 
-                                                   tag_type_p);
-}
-
-int smb_vfs_call_sys_acl_get_permset(struct vfs_handle_struct *handle,
-                                    SMB_ACL_ENTRY_T entry_d,
-                                    SMB_ACL_PERMSET_T *permset_p)
-{
-       VFS_FIND(sys_acl_get_permset);
-       return handle->fns->sys_acl_get_permset_fn(handle, entry_d, permset_p);
-}
-
-void * smb_vfs_call_sys_acl_get_qualifier(struct vfs_handle_struct *handle,
-                                         SMB_ACL_ENTRY_T entry_d)
-{
-       VFS_FIND(sys_acl_get_qualifier);
-       return handle->fns->sys_acl_get_qualifier_fn(handle, entry_d);
-}
-
 SMB_ACL_T smb_vfs_call_sys_acl_get_file(struct vfs_handle_struct *handle,
                                        const char *path_p,
-                                       SMB_ACL_TYPE_T type)
+                                       SMB_ACL_TYPE_T type,
+                                       TALLOC_CTX *mem_ctx)
 {
        VFS_FIND(sys_acl_get_file);
-       return handle->fns->sys_acl_get_file_fn(handle, path_p, type);
+       return handle->fns->sys_acl_get_file_fn(handle, path_p, type, mem_ctx);
 }
 
 SMB_ACL_T smb_vfs_call_sys_acl_get_fd(struct vfs_handle_struct *handle,
-                                     struct files_struct *fsp)
+                                     struct files_struct *fsp,
+                                     TALLOC_CTX *mem_ctx)
 {
        VFS_FIND(sys_acl_get_fd);
-       return handle->fns->sys_acl_get_fd_fn(handle, fsp);
-}
-
-int smb_vfs_call_sys_acl_clear_perms(struct vfs_handle_struct *handle,
-                                    SMB_ACL_PERMSET_T permset)
-{
-       VFS_FIND(sys_acl_clear_perms);
-       return handle->fns->sys_acl_clear_perms_fn(handle, permset);
+       return handle->fns->sys_acl_get_fd_fn(handle, fsp, mem_ctx);
 }
 
-int smb_vfs_call_sys_acl_add_perm(struct vfs_handle_struct *handle,
-                                 SMB_ACL_PERMSET_T permset,
-                                 SMB_ACL_PERM_T perm)
+int smb_vfs_call_sys_acl_blob_get_file(struct vfs_handle_struct *handle,
+                                      const char *path_p,
+                                      SMB_ACL_TYPE_T type,
+                                      TALLOC_CTX *mem_ctx, 
+                                      char **blob_description,
+                                      DATA_BLOB *blob)
 {
-       VFS_FIND(sys_acl_add_perm);
-       return handle->fns->sys_acl_add_perm_fn(handle, permset, perm);
+       VFS_FIND(sys_acl_blob_get_file);
+       return handle->fns->sys_acl_blob_get_file_fn(handle, path_p, type, mem_ctx, blob_description, blob);
 }
 
-char * smb_vfs_call_sys_acl_to_text(struct vfs_handle_struct *handle,
-                                   SMB_ACL_T theacl, ssize_t *plen)
-{
-       VFS_FIND(sys_acl_to_text);
-       return handle->fns->sys_acl_to_text_fn(handle, theacl, plen);
-}
-
-SMB_ACL_T smb_vfs_call_sys_acl_init(struct vfs_handle_struct *handle,
-                                   int count)
-{
-       VFS_FIND(sys_acl_init);
-       return handle->fns->sys_acl_init_fn(handle, count);
-}
-
-int smb_vfs_call_sys_acl_create_entry(struct vfs_handle_struct *handle,
-                                     SMB_ACL_T *pacl, SMB_ACL_ENTRY_T *pentry)
-{
-       VFS_FIND(sys_acl_create_entry);
-       return handle->fns->sys_acl_create_entry_fn(handle, pacl, pentry);
-}
-
-int smb_vfs_call_sys_acl_set_tag_type(struct vfs_handle_struct *handle,
-                                     SMB_ACL_ENTRY_T entry,
-                                     SMB_ACL_TAG_T tagtype)
-{
-       VFS_FIND(sys_acl_set_tag_type);
-       return handle->fns->sys_acl_set_tag_type_fn(handle, entry, tagtype);
-}
-
-int smb_vfs_call_sys_acl_set_qualifier(struct vfs_handle_struct *handle,
-                                      SMB_ACL_ENTRY_T entry, void *qual)
-{
-       VFS_FIND(sys_acl_set_qualifier);
-       return handle->fns->sys_acl_set_qualifier_fn(handle, entry, qual);
-}
-
-int smb_vfs_call_sys_acl_set_permset(struct vfs_handle_struct *handle,
-                                    SMB_ACL_ENTRY_T entry,
-                                    SMB_ACL_PERMSET_T permset)
-{
-       VFS_FIND(sys_acl_set_permset);
-       return handle->fns->sys_acl_set_permset_fn(handle, entry, permset);
-}
-
-int smb_vfs_call_sys_acl_valid(struct vfs_handle_struct *handle,
-                              SMB_ACL_T theacl)
+int smb_vfs_call_sys_acl_blob_get_fd(struct vfs_handle_struct *handle,
+                                    struct files_struct *fsp,
+                                    TALLOC_CTX *mem_ctx, 
+                                    char **blob_description,
+                                    DATA_BLOB *blob)
 {
-       VFS_FIND(sys_acl_valid);
-       return handle->fns->sys_acl_valid_fn(handle, theacl);
+       VFS_FIND(sys_acl_blob_get_fd);
+       return handle->fns->sys_acl_blob_get_fd_fn(handle, fsp, mem_ctx, blob_description, blob);
 }
 
 int smb_vfs_call_sys_acl_set_file(struct vfs_handle_struct *handle,
@@ -2122,36 +2281,6 @@ int smb_vfs_call_sys_acl_delete_def_file(struct vfs_handle_struct *handle,
        return handle->fns->sys_acl_delete_def_file_fn(handle, path);
 }
 
-int smb_vfs_call_sys_acl_get_perm(struct vfs_handle_struct *handle,
-                                 SMB_ACL_PERMSET_T permset,
-                                 SMB_ACL_PERM_T perm)
-{
-       VFS_FIND(sys_acl_get_perm);
-       return handle->fns->sys_acl_get_perm_fn(handle, permset, perm);
-}
-
-int smb_vfs_call_sys_acl_free_text(struct vfs_handle_struct *handle,
-                                  char *text)
-{
-       VFS_FIND(sys_acl_free_text);
-       return handle->fns->sys_acl_free_text_fn(handle, text);
-}
-
-int smb_vfs_call_sys_acl_free_acl(struct vfs_handle_struct *handle,
-                                 SMB_ACL_T posix_acl)
-{
-       VFS_FIND(sys_acl_free_acl);
-       return handle->fns->sys_acl_free_acl_fn(handle, posix_acl);
-}
-
-int smb_vfs_call_sys_acl_free_qualifier(struct vfs_handle_struct *handle,
-                                       void *qualifier, SMB_ACL_TAG_T tagtype)
-{
-       VFS_FIND(sys_acl_free_qualifier);
-       return handle->fns->sys_acl_free_qualifier_fn(handle, qualifier, 
-                                                     tagtype);
-}
-
 ssize_t smb_vfs_call_getxattr(struct vfs_handle_struct *handle,
                              const char *path, const char *name, void *value,
                              size_t size)
@@ -2213,60 +2342,6 @@ int smb_vfs_call_fsetxattr(struct vfs_handle_struct *handle,
        return handle->fns->fsetxattr_fn(handle, fsp, name, value, size, flags);
 }
 
-int smb_vfs_call_aio_read(struct vfs_handle_struct *handle,
-                         struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-       VFS_FIND(aio_read);
-       return handle->fns->aio_read_fn(handle, fsp, aiocb);
-}
-
-int smb_vfs_call_aio_write(struct vfs_handle_struct *handle,
-                          struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-       VFS_FIND(aio_write);
-       return handle->fns->aio_write_fn(handle, fsp, aiocb);
-}
-
-ssize_t smb_vfs_call_aio_return(struct vfs_handle_struct *handle,
-                               struct files_struct *fsp,
-                               SMB_STRUCT_AIOCB *aiocb)
-{
-       VFS_FIND(aio_return);
-       return handle->fns->aio_return_fn(handle, fsp, aiocb);
-}
-
-int smb_vfs_call_aio_cancel(struct vfs_handle_struct *handle,
-                           struct files_struct *fsp, SMB_STRUCT_AIOCB *aiocb)
-{
-       VFS_FIND(aio_cancel);
-       return handle->fns->aio_cancel_fn(handle, fsp, aiocb);
-}
-
-int smb_vfs_call_aio_error(struct vfs_handle_struct *handle,
-                          struct files_struct *fsp,
-                          SMB_STRUCT_AIOCB *aiocb)
-{
-       VFS_FIND(aio_error);
-       return handle->fns->aio_error_fn(handle, fsp, aiocb);
-}
-
-int smb_vfs_call_aio_fsync(struct vfs_handle_struct *handle,
-                          struct files_struct *fsp, int op,
-                          SMB_STRUCT_AIOCB *aiocb)
-{
-       VFS_FIND(aio_fsync);
-       return handle->fns->aio_fsync_fn(handle, fsp, op, aiocb);
-}
-
-int smb_vfs_call_aio_suspend(struct vfs_handle_struct *handle,
-                            struct files_struct *fsp,
-                            const SMB_STRUCT_AIOCB * const aiocb[], int n,
-                            const struct timespec *timeout)
-{
-       VFS_FIND(aio_suspend);
-       return handle->fns->aio_suspend_fn(handle, fsp, aiocb, n, timeout);
-}
-
 bool smb_vfs_call_aio_force(struct vfs_handle_struct *handle,
                            struct files_struct *fsp)
 {
@@ -2288,3 +2363,37 @@ int smb_vfs_call_set_offline(struct vfs_handle_struct *handle,
        VFS_FIND(set_offline);
        return handle->fns->set_offline_fn(handle, fname);
 }
+
+NTSTATUS smb_vfs_call_durable_cookie(struct vfs_handle_struct *handle,
+                                    struct files_struct *fsp,
+                                    TALLOC_CTX *mem_ctx,
+                                    DATA_BLOB *cookie)
+{
+       VFS_FIND(durable_cookie);
+       return handle->fns->durable_cookie_fn(handle, fsp, mem_ctx, cookie);
+}
+
+NTSTATUS smb_vfs_call_durable_disconnect(struct vfs_handle_struct *handle,
+                                        struct files_struct *fsp,
+                                        const DATA_BLOB old_cookie,
+                                        TALLOC_CTX *mem_ctx,
+                                        DATA_BLOB *new_cookie)
+{
+       VFS_FIND(durable_disconnect);
+       return handle->fns->durable_disconnect_fn(handle, fsp, old_cookie,
+                                                 mem_ctx, new_cookie);
+}
+
+NTSTATUS smb_vfs_call_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)
+{
+       VFS_FIND(durable_reconnect);
+       return handle->fns->durable_reconnect_fn(handle, smb1req, op,
+                                                old_cookie, mem_ctx, fsp,
+                                                new_cookie);
+}