vfs: remove SMB_VFS_OPEN()
authorRalph Boehme <slow@samba.org>
Wed, 20 May 2020 21:26:14 +0000 (23:26 +0200)
committerJeremy Allison <jra@samba.org>
Thu, 21 May 2020 20:38:34 +0000 (20:38 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
34 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_aio_pthread.c
source3/modules/vfs_audit.c
source3/modules/vfs_cap.c
source3/modules/vfs_catia.c
source3/modules/vfs_ceph.c
source3/modules/vfs_ceph_snapshots.c
source3/modules/vfs_commit.c
source3/modules/vfs_default.c
source3/modules/vfs_error_inject.c
source3/modules/vfs_extd_audit.c
source3/modules/vfs_fruit.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_gpfs.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_not_implemented.c
source3/modules/vfs_prealloc.c
source3/modules/vfs_preopen.c
source3/modules/vfs_shadow_copy2.c
source3/modules/vfs_snapper.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c
source3/modules/vfs_syncops.c
source3/modules/vfs_time_audit.c
source3/modules/vfs_unityed_media.c
source3/modules/vfs_virusfilter.c
source3/modules/vfs_widelinks.c
source3/modules/vfs_xattr_tdb.c
source3/script/tests/test_open_eintr.sh
source3/smbd/vfs.c

index 4c42e3d96c25e85b9de87000974fb613853dc954..1a9b472634db72f28cd510b5c134a7157287b3cf 100644 (file)
@@ -191,13 +191,6 @@ static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
        return -1;
 }
 
-static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
-                    files_struct *fsp, int flags, mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 static int skel_openat(struct vfs_handle_struct *handle,
                       const struct files_struct *dirfsp,
                       const struct smb_filename *smb_fname,
@@ -1073,7 +1066,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
 
        /* File operations */
 
-       .open_fn = skel_open,
        .openat_fn = skel_openat,
        .create_file_fn = skel_create_file,
        .close_fn = skel_close_fn,
index a57102607e36ceedb5156373cd184c12e392186e..fdb6d0d5f54bee0a5473d69b5588f30707c79963 100644 (file)
@@ -200,12 +200,6 @@ static int skel_closedir(vfs_handle_struct *handle, DIR *dir)
        return SMB_VFS_NEXT_CLOSEDIR(handle, dir);
 }
 
-static int skel_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
-                    files_struct *fsp, int flags, mode_t mode)
-{
-       return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-}
-
 static int skel_openat(struct vfs_handle_struct *handle,
                       const struct files_struct *dirfsp,
                       const struct smb_filename *smb_fname,
@@ -1380,7 +1374,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
 
        /* File operations */
 
-       .open_fn = skel_open,
        .openat_fn = skel_openat,
        .create_file_fn = skel_create_file,
        .close_fn = skel_close_fn,
index 17516c1b12e29a3ac52337e8e1a91ec36a6928f8..3126f2286269d20d05517baa9d6e579f760e6507 100644 (file)
  * Version 43 - Add dirfsp to struct files_struct
  * Version 43 - Add dirfsp args to SMB_VFS_CREATE_FILE()
  * Version 43 - Add SMB_VFS_OPENAT()
+ * Version 43 - Remove SMB_VFS_OPEN()
  */
 
 #define SMB_VFS_INTERFACE_VERSION 43
@@ -762,9 +763,6 @@ struct vfs_fn_pointers {
 
        /* File operations */
 
-       int (*open_fn)(struct vfs_handle_struct *handle,
-                      struct smb_filename *smb_fname, files_struct *fsp,
-                      int flags, mode_t mode);
        int (*openat_fn)(struct vfs_handle_struct *handle,
                         const struct files_struct *dirfsp,
                         const struct smb_filename *smb_fname,
@@ -1280,9 +1278,6 @@ int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle,
                        mode_t mode);
 int smb_vfs_call_closedir(struct vfs_handle_struct *handle,
                          DIR *dir);
-int smb_vfs_call_open(struct vfs_handle_struct *handle,
-                     struct smb_filename *smb_fname, struct files_struct *fsp,
-                     int flags, mode_t mode);
 int smb_vfs_call_openat(struct vfs_handle_struct *handle,
                        const struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
index 6eaf47f76b228deb01a8d21b2e7c7e7f356ca0ec..e0a8d39194546ba3a884e771d2f247dba6a311c1 100644 (file)
        smb_vfs_call_closedir((handle)->next, (dir))
 
 /* File operations */
-#define SMB_VFS_OPEN(conn, fname, fsp, flags, mode) \
-       smb_vfs_call_open((conn)->vfs_handles, (fname), (fsp), (flags), (mode))
-#define SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode) \
-       smb_vfs_call_open((handle)->next, (fname), (fsp), (flags), (mode))
-
 #define SMB_VFS_OPENAT(conn, dirfsp, smb_fname, fsp, flags, mode) \
        smb_vfs_call_openat((conn)->vfs_handles, (dirfsp), (smb_fname), (fsp), (flags), (mode))
 #define SMB_VFS_NEXT_OPENAT(handle, dirfsp, smb_fname, fsp, flags, mode) \
index 37f883b47ced7b6cd8f99c6ce7b0145ad0c7ca6c..265bae411d6caf3027e4b280c903f7225e045c73 100644 (file)
@@ -446,63 +446,6 @@ static bool find_completed_open(files_struct *fsp,
  opens to prevent any race conditions.
 *****************************************************************/
 
-static int aio_pthread_open_fn(vfs_handle_struct *handle,
-                       struct smb_filename *smb_fname,
-                       files_struct *fsp,
-                       int flags,
-                       mode_t mode)
-{
-       int my_errno = 0;
-       int fd = -1;
-       bool aio_allow_open = lp_parm_bool(
-               SNUM(handle->conn), "aio_pthread", "aio open", false);
-       struct files_struct *fspcwd = NULL;
-       NTSTATUS status;
-
-       if (smb_fname->stream_name) {
-               /* Don't handle stream opens. */
-               errno = ENOENT;
-               return -1;
-       }
-
-       if (!aio_allow_open) {
-               /* aio opens turned off. */
-               return open(smb_fname->base_name, flags, mode);
-       }
-
-       if (!(flags & O_CREAT)) {
-               /* Only creates matter. */
-               return open(smb_fname->base_name, flags, mode);
-       }
-
-       if (!(flags & O_EXCL)) {
-               /* Only creates with O_EXCL matter. */
-               return open(smb_fname->base_name, flags, mode);
-       }
-
-       /*
-        * See if this is a reentrant call - i.e. is this a
-        * restart of an existing open that just completed.
-        */
-
-       if (find_completed_open(fsp,
-                               &fd,
-                               &my_errno)) {
-               errno = my_errno;
-               return fd;
-       }
-
-       status = vfs_at_fspcwd(talloc_tos(), handle->conn, &fspcwd);
-       if (!NT_STATUS_IS_OK(status)) {
-               return -1;
-       }
-
-       /* Ok, it's a create exclusive call - pass it to a thread helper. */
-       fd = open_async(fspcwd, smb_fname, fsp, flags, mode);
-       TALLOC_FREE(fspcwd);
-       return fd;
-}
-
 static int aio_pthread_openat_fn(vfs_handle_struct *handle,
                                 const struct files_struct *dirfsp,
                                 const struct smb_filename *smb_fname,
@@ -564,7 +507,6 @@ static int aio_pthread_openat_fn(vfs_handle_struct *handle,
 
 static struct vfs_fn_pointers vfs_aio_pthread_fns = {
 #if defined(HAVE_OPENAT) && defined(HAVE_LINUX_THREAD_CREDENTIALS)
-       .open_fn = aio_pthread_open_fn,
        .openat_fn = aio_pthread_openat_fn,
 #endif
 };
index 464dbde26406e32d05ac5d78487c60a6f723cc84..ce7eb7a46fbd65805e4511ac523e0681351fb725 100644 (file)
@@ -197,23 +197,6 @@ static int audit_mkdirat(vfs_handle_struct *handle,
        return result;
 }
 
-static int audit_open(vfs_handle_struct *handle,
-                     struct smb_filename *smb_fname, files_struct *fsp,
-                     int flags, mode_t mode)
-{
-       int result;
-
-       result = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-
-       syslog(audit_syslog_priority(handle), "open %s (fd %d) %s%s%s\n", 
-              smb_fname->base_name, result,
-              ((flags & O_WRONLY) || (flags & O_RDWR)) ? "for writing " : "", 
-              (result < 0) ? "failed: " : "",
-              (result < 0) ? strerror(errno) : "");
-
-       return result;
-}
-
 static int audit_openat(vfs_handle_struct *handle,
                        const struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -326,7 +309,6 @@ static struct vfs_fn_pointers vfs_audit_fns = {
        .connect_fn = audit_connect,
        .disconnect_fn = audit_disconnect,
        .mkdirat_fn = audit_mkdirat,
-       .open_fn = audit_open,
        .openat_fn = audit_openat,
        .close_fn = audit_close,
        .renameat_fn = audit_renameat,
index 7bf11a7bb9db9921acdfe1838ececbb7102c8e69..c713d30301e9ebd472ab7529c294c95b7ad7993f 100644 (file)
@@ -147,32 +147,6 @@ static int cap_mkdirat(vfs_handle_struct *handle,
                        mode);
 }
 
-static int cap_open(vfs_handle_struct *handle, struct smb_filename *smb_fname,
-                   files_struct *fsp, int flags, mode_t mode)
-{
-       char *cappath;
-       char *tmp_base_name = NULL;
-       int ret;
-
-       cappath = capencode(talloc_tos(), smb_fname->base_name);
-
-       if (!cappath) {
-               errno = ENOMEM;
-               return -1;
-       }
-
-       tmp_base_name = smb_fname->base_name;
-       smb_fname->base_name = cappath;
-
-       DEBUG(3,("cap: cap_open for %s\n", smb_fname_str_dbg(smb_fname)));
-       ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-
-       smb_fname->base_name = tmp_base_name;
-       TALLOC_FREE(cappath);
-
-       return ret;
-}
-
 static int cap_openat(vfs_handle_struct *handle,
                      const struct files_struct *dirfsp,
                      const struct smb_filename *smb_fname_in,
@@ -1106,7 +1080,6 @@ static struct vfs_fn_pointers vfs_cap_fns = {
        .get_quota_fn = cap_get_quota,
        .readdir_fn = cap_readdir,
        .mkdirat_fn = cap_mkdirat,
-       .open_fn = cap_open,
        .openat_fn = cap_openat,
        .renameat_fn = cap_renameat,
        .stat_fn = cap_stat,
index 84e7e784c999bffe29fa95cf74962567cb5083c5..6fc14de076b37ec9d57c0fb2670fbd1ba929cfdd 100644 (file)
@@ -485,42 +485,6 @@ static void catia_fetch_fsp_post_next(struct catia_cache **_cc,
        return;
 }
 
-static int catia_open(vfs_handle_struct *handle,
-                     struct smb_filename *smb_fname,
-                     files_struct *fsp,
-                     int flags,
-                     mode_t mode)
-{
-       struct catia_cache *cc = NULL;
-       char *orig_smb_fname = smb_fname->base_name;
-       char *mapped_smb_fname = NULL;
-       NTSTATUS status;
-       int ret;
-
-       status = catia_string_replace_allocate(handle->conn,
-                                              smb_fname->base_name,
-                                              &mapped_smb_fname,
-                                              vfs_translate_to_unix);
-       if (!NT_STATUS_IS_OK(status)) {
-               return -1;
-       }
-
-       ret = CATIA_FETCH_FSP_PRE_NEXT(talloc_tos(), handle, fsp, &cc);
-       if (ret != 0) {
-               TALLOC_FREE(mapped_smb_fname);
-               return ret;
-       }
-
-       smb_fname->base_name = mapped_smb_fname;
-       ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       smb_fname->base_name = orig_smb_fname;
-
-       TALLOC_FREE(mapped_smb_fname);
-       CATIA_FETCH_FSP_POST_NEXT(&cc, fsp);
-
-       return ret;
-}
-
 static int catia_openat(vfs_handle_struct *handle,
                        const struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname_in,
@@ -2500,7 +2464,6 @@ static struct vfs_fn_pointers vfs_catia_fns = {
        .readdir_attr_fn = catia_readdir_attr,
 
        /* File operations */
-       .open_fn = catia_open,
        .openat_fn = catia_openat,
        .pread_fn = catia_pread,
        .pread_send_fn = catia_pread_send,
index c4e65dc4d23c557f763c1f98bc020f6f545f4162..767a2ad86091feda02d145afd279d6f4ea4087fc 100644 (file)
@@ -391,24 +391,6 @@ static int cephwrap_closedir(struct vfs_handle_struct *handle, DIR *dirp)
 
 /* File operations */
 
-static int cephwrap_open(struct vfs_handle_struct *handle,
-                       struct smb_filename *smb_fname,
-                       files_struct *fsp, int flags, mode_t mode)
-{
-       int result = -ENOENT;
-       DBG_DEBUG("[CEPH] open(%p, %s, %p, %d, %d)\n", handle,
-                 smb_fname_str_dbg(smb_fname), fsp, flags, mode);
-
-       if (smb_fname->stream_name) {
-               goto out;
-       }
-
-       result = ceph_open(handle->data, smb_fname->base_name, flags, mode);
-out:
-       DBG_DEBUG("[CEPH] open(...) = %d\n", result);
-       WRAP_RETURN(result);
-}
-
 static int cephwrap_openat(struct vfs_handle_struct *handle,
                           const struct files_struct *dirfsp,
                           const struct smb_filename *smb_fname,
@@ -1470,7 +1452,6 @@ static struct vfs_fn_pointers ceph_fns = {
 
        .create_dfs_pathat_fn = cephwrap_create_dfs_pathat,
        .read_dfs_pathat_fn = cephwrap_read_dfs_pathat,
-       .open_fn = cephwrap_open,
        .openat_fn = cephwrap_openat,
        .close_fn = cephwrap_close,
        .pread_fn = cephwrap_pread,
index d529009552543d025060958b2bef0d4686757754..00cb72d6974510051456dbce8897a91d74323631 100644 (file)
@@ -850,41 +850,6 @@ static int ceph_snap_gmt_lstat(vfs_handle_struct *handle,
        return ret;
 }
 
-static int ceph_snap_gmt_open(vfs_handle_struct *handle,
-                           struct smb_filename *smb_fname, files_struct *fsp,
-                           int flags, mode_t mode)
-{
-       time_t timestamp = 0;
-       char stripped[PATH_MAX + 1];
-       char conv[PATH_MAX + 1];
-       char *tmp;
-       int ret;
-
-       ret = ceph_snap_gmt_strip_snapshot(handle,
-                                       smb_fname,
-                                       &timestamp, stripped, sizeof(stripped));
-       if (ret < 0) {
-               errno = -ret;
-               return -1;
-       }
-       if (timestamp == 0) {
-               return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       }
-
-       ret = ceph_snap_gmt_convert(handle, stripped,
-                                       timestamp, conv, sizeof(conv));
-       if (ret < 0) {
-               errno = -ret;
-               return -1;
-       }
-       tmp = smb_fname->base_name;
-       smb_fname->base_name = conv;
-
-       ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       smb_fname->base_name = tmp;
-       return ret;
-}
-
 static int ceph_snap_gmt_openat(vfs_handle_struct *handle,
                                const struct files_struct *dirfsp,
                                const struct smb_filename *smb_fname_in,
@@ -1540,7 +1505,6 @@ static struct vfs_fn_pointers ceph_snap_fns = {
        .symlinkat_fn = ceph_snap_gmt_symlinkat,
        .stat_fn = ceph_snap_gmt_stat,
        .lstat_fn = ceph_snap_gmt_lstat,
-       .open_fn = ceph_snap_gmt_open,
        .openat_fn = ceph_snap_gmt_openat,
        .unlinkat_fn = ceph_snap_gmt_unlinkat,
        .chmod_fn = ceph_snap_gmt_chmod,
index 010a86cab95c7fd1d1821627873abc3f3f609ee1..fae94329af3bebaf046332e9838cf6fd2ec9701f 100644 (file)
@@ -177,77 +177,6 @@ static int commit_connect(
         return 0;
 }
 
-static int commit_open(
-       vfs_handle_struct * handle,
-       struct smb_filename *smb_fname,
-       files_struct *      fsp,
-       int                 flags,
-       mode_t              mode)
-{
-        off_t dthresh;
-       const char *eof_mode;
-        struct commit_info *c = NULL;
-        int fd;
-
-        /* Don't bother with read-only files. */
-        if ((flags & O_ACCMODE) == O_RDONLY) {
-                return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-        }
-
-        /* Read and check module configuration */
-        dthresh = conv_str_size(lp_parm_const_string(SNUM(handle->conn),
-                                        MODULE, "dthresh", NULL));
-
-       eof_mode = lp_parm_const_string(SNUM(handle->conn),
-                                        MODULE, "eof mode", "none");
-
-        if (dthresh > 0 || !strequal(eof_mode, "none")) {
-                c = VFS_ADD_FSP_EXTENSION(
-                       handle, fsp, struct commit_info, NULL);
-                /* Process main tunables */
-                if (c) {
-                        c->dthresh = dthresh;
-                        c->dbytes = 0;
-                        c->on_eof = EOF_NONE;
-                        c->eof = 0;
-                }
-        }
-        /* Process eof_mode tunable */
-        if (c) {
-                if (strequal(eof_mode, "hinted")) {
-                        c->on_eof = EOF_HINTED;
-                } else if (strequal(eof_mode, "growth")) {
-                        c->on_eof = EOF_GROWTH;
-                }
-        }
-
-        fd = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       if (fd == -1) {
-               VFS_REMOVE_FSP_EXTENSION(handle, fsp);
-               return fd;
-       }
-
-        /* EOF commit modes require us to know the initial file size. */
-        if (c && (c->on_eof != EOF_NONE)) {
-                SMB_STRUCT_STAT st;
-               /*
-                * Setting the fd of the FSP is a hack
-                * but also practiced elsewhere -
-                * needed for calling the VFS.
-                */
-               fsp->fh->fd = fd;
-               if (SMB_VFS_FSTAT(fsp, &st) == -1) {
-                       int saved_errno = errno;
-                       SMB_VFS_CLOSE(fsp);
-                       errno = saved_errno;
-                        return -1;
-                }
-               c->eof = st.st_ex_size;
-        }
-
-        return fd;
-}
-
 static int commit_openat(struct vfs_handle_struct *handle,
                         const struct files_struct *dirfsp,
                         const struct smb_filename *smb_fname,
@@ -451,7 +380,6 @@ static int commit_ftruncate(
 }
 
 static struct vfs_fn_pointers vfs_commit_fns = {
-        .open_fn = commit_open,
         .openat_fn = commit_openat,
         .close_fn = commit_close,
         .pwrite_fn = commit_pwrite,
index 06dd53e2d4ff7977b968c0b16aeae6ba88587366..5047582ce465f22f77194dc9fc5d971377d4402a 100644 (file)
@@ -669,25 +669,6 @@ static int vfswrap_closedir(vfs_handle_struct *handle, DIR *dirp)
 
 /* File operations */
 
-static int vfswrap_open(vfs_handle_struct *handle,
-                       struct smb_filename *smb_fname,
-                       files_struct *fsp, int flags, mode_t mode)
-{
-       int result = -1;
-
-       START_PROFILE(syscall_open);
-
-       if (is_named_stream(smb_fname)) {
-               errno = ENOENT;
-               goto out;
-       }
-
-       result = open(smb_fname->base_name, flags, mode);
- out:
-       END_PROFILE(syscall_open);
-       return result;
-}
-
 static int vfswrap_openat(vfs_handle_struct *handle,
                          const struct files_struct *dirfsp,
                          const struct smb_filename *smb_fname,
@@ -3701,7 +3682,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
 
        /* File operations */
 
-       .open_fn = vfswrap_open,
        .openat_fn = vfswrap_openat,
        .create_file_fn = vfswrap_create_file,
        .close_fn = vfswrap_close,
index c67b622fbe6037e69e063d9d470f11171e03fdbf..04880ffd5ab77603db7202f314017f9b386befee 100644 (file)
@@ -107,21 +107,6 @@ static ssize_t vfs_error_inject_pwrite(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
 }
 
-static int vfs_error_inject_open(
-       struct vfs_handle_struct *handle,
-       struct smb_filename *smb_fname,
-       files_struct *fsp,
-       int flags,
-       mode_t mode)
-{
-       int error = inject_unix_error("open", handle);
-       if (error != 0) {
-               errno = error;
-               return -1;
-       }
-       return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-}
-
 static int vfs_error_inject_openat(struct vfs_handle_struct *handle,
                                   const struct files_struct *dirfsp,
                                   const struct smb_filename *smb_fname,
@@ -140,7 +125,6 @@ static int vfs_error_inject_openat(struct vfs_handle_struct *handle,
 static struct vfs_fn_pointers vfs_error_inject_fns = {
        .chdir_fn = vfs_error_inject_chdir,
        .pwrite_fn = vfs_error_inject_pwrite,
-       .open_fn = vfs_error_inject_open,
        .openat_fn = vfs_error_inject_openat,
 };
 
index d38a09a2b54ab057f6e5ad2bc78ab602bd29e0cd..4eaaf1f6ce0641aad45e1297602cbef482854488 100644 (file)
@@ -213,29 +213,6 @@ static int audit_mkdirat(vfs_handle_struct *handle,
        return result;
 }
 
-static int audit_open(vfs_handle_struct *handle,
-                     struct smb_filename *smb_fname, files_struct *fsp,
-                     int flags, mode_t mode)
-{
-       int result;
-
-       result = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-
-       if (lp_syslog() > 0) {
-               syslog(audit_syslog_priority(handle), "open %s (fd %d) %s%s%s\n",
-                      smb_fname->base_name, result,
-                      ((flags & O_WRONLY) || (flags & O_RDWR)) ? "for writing " : "",
-                      (result < 0) ? "failed: " : "",
-                      (result < 0) ? strerror(errno) : "");
-       }
-       DEBUG(2, ("vfs_extd_audit: open %s %s %s\n",
-              smb_fname_str_dbg(smb_fname),
-              (result < 0) ? "failed: " : "",
-              (result < 0) ? strerror(errno) : ""));
-
-       return result;
-}
-
 static int audit_openat(vfs_handle_struct *handle,
                        const struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -389,7 +366,6 @@ static struct vfs_fn_pointers vfs_extd_audit_fns = {
        .connect_fn = audit_connect,
        .disconnect_fn = audit_disconnect,
        .mkdirat_fn = audit_mkdirat,
-       .open_fn = audit_open,
        .openat_fn = audit_openat,
        .close_fn = audit_close,
        .renameat_fn = audit_renameat,
index 099bf02d7719021903a72ac68d10b53d97651835..51251b7b86beae25b87be6ddc4fc0d8113e2838d 100644 (file)
@@ -1628,59 +1628,6 @@ static int fruit_open_rsrc(vfs_handle_struct *handle,
        return fd;
 }
 
-static int fruit_open(vfs_handle_struct *handle,
-                      struct smb_filename *smb_fname,
-                      files_struct *fsp, int flags, mode_t mode)
-{
-       struct files_struct *fspcwd = NULL;
-       int saved_errno = 0;
-       int fd;
-       NTSTATUS status;
-
-       DBG_DEBUG("Path [%s]\n", smb_fname_str_dbg(smb_fname));
-
-       if (!is_named_stream(smb_fname)) {
-               return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       }
-
-       status = vfs_at_fspcwd(talloc_tos(),
-                              handle->conn,
-                              &fspcwd);
-       if (!NT_STATUS_IS_OK(status)) {
-               errno = map_errno_from_nt_status(status);
-               return -1;
-       }
-
-       if (is_afpinfo_stream(smb_fname->stream_name)) {
-               fd = fruit_open_meta(handle,
-                                    fspcwd,
-                                    smb_fname,
-                                    fsp,
-                                    flags,
-                                    mode);
-       } else if (is_afpresource_stream(smb_fname->stream_name)) {
-               fd = fruit_open_rsrc(handle,
-                                    fspcwd,
-                                    smb_fname,
-                                    fsp,
-                                    flags,
-                                    mode);
-       } else {
-               fd = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       }
-       if (fd == -1) {
-               saved_errno = errno;
-       }
-       TALLOC_FREE(fspcwd);
-
-       DBG_DEBUG("Path [%s] fd [%d]\n", smb_fname_str_dbg(smb_fname), fd);
-
-       if (saved_errno != 0) {
-               errno = saved_errno;
-       }
-       return fd;
-}
-
 static int fruit_openat(vfs_handle_struct *handle,
                        const struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -5122,7 +5069,6 @@ static struct vfs_fn_pointers vfs_fruit_fns = {
        .chmod_fn = fruit_chmod,
        .unlinkat_fn = fruit_unlinkat,
        .renameat_fn = fruit_renameat,
-       .open_fn = fruit_open,
        .openat_fn = fruit_openat,
        .close_fn = fruit_close,
        .pread_fn = fruit_pread,
index 15bc0fd4b916f97d6dc5f6ef117adae8af351493..3e10a8c4127618901fd8f18001b197fbc3535724 100644 (file)
@@ -1078,21 +1078,6 @@ static int smb_full_audit_closedir(vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_full_audit_open(vfs_handle_struct *handle,
-                              struct smb_filename *smb_fname,
-                              files_struct *fsp, int flags, mode_t mode)
-{
-       int result;
-       
-       result = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-
-       do_log(SMB_VFS_OP_OPEN, (result >= 0), handle, "%s|%s",
-              ((flags & O_WRONLY) || (flags & O_RDWR))?"w":"r",
-              smb_fname_str_do_log(handle->conn, smb_fname));
-
-       return result;
-}
-
 static int smb_full_audit_openat(vfs_handle_struct *handle,
                                 const struct files_struct *dirfsp,
                                 const struct smb_filename *smb_fname,
@@ -3006,7 +2991,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .rewind_dir_fn = smb_full_audit_rewinddir,
        .mkdirat_fn = smb_full_audit_mkdirat,
        .closedir_fn = smb_full_audit_closedir,
-       .open_fn = smb_full_audit_open,
        .openat_fn = smb_full_audit_openat,
        .create_file_fn = smb_full_audit_create_file,
        .close_fn = smb_full_audit_close,
index c4b779a3c1c23602ed126c6193864614e5ce328d..843cf5be78f01425a2c20751e49986bbff7df2bb 100644 (file)
@@ -604,45 +604,6 @@ static int vfs_gluster_mkdirat(struct vfs_handle_struct *handle,
        return ret;
 }
 
-static int vfs_gluster_open(struct vfs_handle_struct *handle,
-                           struct smb_filename *smb_fname, files_struct *fsp,
-                           int flags, mode_t mode)
-{
-       glfs_fd_t *glfd;
-       glfs_fd_t **p_tmp;
-
-       START_PROFILE(syscall_open);
-
-       p_tmp = VFS_ADD_FSP_EXTENSION(handle, fsp, glfs_fd_t *, NULL);
-       if (p_tmp == NULL) {
-               END_PROFILE(syscall_open);
-               errno = ENOMEM;
-               return -1;
-       }
-
-       if (flags & O_DIRECTORY) {
-               glfd = glfs_opendir(handle->data, smb_fname->base_name);
-       } else if (flags & O_CREAT) {
-               glfd = glfs_creat(handle->data, smb_fname->base_name, flags,
-                                 mode);
-       } else {
-               glfd = glfs_open(handle->data, smb_fname->base_name, flags);
-       }
-
-       if (glfd == NULL) {
-               END_PROFILE(syscall_open);
-               /* no extension destroy_fn, so no need to save errno */
-               VFS_REMOVE_FSP_EXTENSION(handle, fsp);
-               return -1;
-       }
-
-       *p_tmp = glfd;
-
-       END_PROFILE(syscall_open);
-       /* An arbitrary value for error reporting, so you know its us. */
-       return 13371337;
-}
-
 static int vfs_gluster_openat(struct vfs_handle_struct *handle,
                              const struct files_struct *dirfsp,
                              const struct smb_filename *smb_fname,
@@ -2091,7 +2052,6 @@ static struct vfs_fn_pointers glusterfs_fns = {
 
        /* File Operations */
 
-       .open_fn = vfs_gluster_open,
        .openat_fn = vfs_gluster_openat,
        .create_file_fn = NULL,
        .close_fn = vfs_gluster_close,
index e7a67b2e411c7e519c55eeac4bda72702971f2f7..8707a08f842b0c43994a63914358d1d0b2dd11ba 100644 (file)
@@ -2503,49 +2503,6 @@ static uint32_t vfs_gpfs_capabilities(struct vfs_handle_struct *handle,
        return next;
 }
 
-static int vfs_gpfs_open(struct vfs_handle_struct *handle,
-                        struct smb_filename *smb_fname, files_struct *fsp,
-                        int flags, mode_t mode)
-{
-       struct gpfs_config_data *config;
-       int ret;
-       struct gpfs_fsp_extension *ext;
-
-       SMB_VFS_HANDLE_GET_DATA(handle, config,
-                               struct gpfs_config_data,
-                               return -1);
-
-       if (config->hsm && !config->recalls &&
-           vfs_gpfs_fsp_is_offline(handle, fsp)) {
-               DEBUG(10, ("Refusing access to offline file %s\n",
-                          fsp_str_dbg(fsp)));
-               errno = EACCES;
-               return -1;
-       }
-
-       if (config->syncio) {
-               flags |= O_SYNC;
-       }
-
-       ext = VFS_ADD_FSP_EXTENSION(handle, fsp, struct gpfs_fsp_extension,
-                                   NULL);
-       if (ext == NULL) {
-               errno = ENOMEM;
-               return -1;
-       }
-
-       /*
-        * Assume the file is offline until gpfs tells us it's online.
-        */
-       *ext = (struct gpfs_fsp_extension) { .offline = true };
-
-       ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       if (ret == -1) {
-               VFS_REMOVE_FSP_EXTENSION(handle, fsp);
-       }
-       return ret;
-}
-
 static int vfs_gpfs_openat(struct vfs_handle_struct *handle,
                           const struct files_struct *dirfsp,
                           const struct smb_filename *smb_fname,
@@ -2802,7 +2759,6 @@ static struct vfs_fn_pointers vfs_gpfs_fns = {
        .aio_force_fn = vfs_gpfs_aio_force,
        .sendfile_fn = vfs_gpfs_sendfile,
        .fallocate_fn = vfs_gpfs_fallocate,
-       .open_fn = vfs_gpfs_open,
        .openat_fn = vfs_gpfs_openat,
        .pread_fn = vfs_gpfs_pread,
        .pread_send_fn = vfs_gpfs_pread_send,
index a4ff36768adbc34bf45c770072fcdcf0553ab98e..202c711ff92f4af3196653b05f4eca1cb65769e9 100644 (file)
@@ -1043,62 +1043,6 @@ static int mh_closedir(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_CLOSEDIR(handle, realdirp);
 }
 
-/*
- * Success: return non-negative file descriptor
- * Failure: set errno, return -1
- */
-static int mh_open(vfs_handle_struct *handle,
-               struct smb_filename *smb_fname,
-               files_struct *fsp,
-               int flags,
-               mode_t mode)
-{
-       int ret;
-       struct smb_filename *clientFname;
-       TALLOC_CTX *ctx;
-
-
-       DEBUG(MH_INFO_DEBUG, ("Entering with smb_fname->base_name '%s'\n",
-                             smb_fname->base_name));
-
-       if (!is_in_media_files(smb_fname->base_name))
-       {
-               ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags,
-                               mode);
-               goto out;
-       }
-
-       clientFname = NULL;
-       ctx = talloc_tos();
-
-       if(alloc_get_client_smb_fname(handle, ctx,
-                               smb_fname,
-                               &clientFname))
-       {
-               ret = -1;
-               goto err;
-       }
-
-       // What about fsp->fsp_name?
-       // We also have to get correct stat info into fsp and smb_fname
-       // for DB files, don't we?
-
-       DEBUG(MH_INFO_DEBUG, ("Leaving with smb_fname->base_name '%s' "
-                       "smb_fname->st.st_ex_mtime %s"
-                       "               fsp->fsp_name->st.st_ex_mtime %s",
-                       smb_fname->base_name,
-                       ctime(&(smb_fname->st.st_ex_mtime.tv_sec)),
-                       ctime(&(fsp->fsp_name->st.st_ex_mtime.tv_sec))));
-
-       ret = SMB_VFS_NEXT_OPEN(handle, clientFname, fsp, flags, mode);
-err:
-       TALLOC_FREE(clientFname);
-out:
-       DEBUG(MH_INFO_DEBUG, ("Leaving with smb_fname->base_name '%s'\n",
-                               smb_fname->base_name));
-       return ret;
-}
-
 /*
  * Success: return non-negative file descriptor
  * Failure: set errno, return -1
@@ -2272,7 +2216,6 @@ static struct vfs_fn_pointers vfs_mh_fns = {
 
        /* File operations */
 
-       .open_fn = mh_open,
        .openat_fn = mh_openat,
        .create_file_fn = mh_create_file,
        .renameat_fn = mh_renameat,
index 3521fb1248032ee4145f2ea75f01934a354795d7..ca12406ac07d89cab7025a9010079047c268eed3 100644 (file)
@@ -188,14 +188,6 @@ int vfs_not_implemented_closedir(vfs_handle_struct *handle, DIR *dir)
        return -1;
 }
 
-int vfs_not_implemented_open(vfs_handle_struct *handle,
-                            struct smb_filename *smb_fname,
-                            files_struct *fsp, int flags, mode_t mode)
-{
-       errno = ENOSYS;
-       return -1;
-}
-
 int vfs_not_implemented_openat(vfs_handle_struct *handle,
                               const struct files_struct *dirfsp,
                               const struct smb_filename *smb_fname,
@@ -1078,7 +1070,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
 
        /* File operations */
 
-       .open_fn = vfs_not_implemented_open,
        .openat_fn = vfs_not_implemented_openat,
        .create_file_fn = vfs_not_implemented_create_file,
        .close_fn = vfs_not_implemented_close_fn,
index cf3019c588a9a3dfe1d6b2e03dbe2a9936381b26..bbb5e55897b19b800ba219bbd942fe880b856c7b 100644 (file)
@@ -106,92 +106,6 @@ static int prealloc_connect(
        return 0;
 }
 
-static int prealloc_open(vfs_handle_struct* handle,
-                       struct smb_filename *smb_fname,
-                       files_struct *      fsp,
-                       int                 flags,
-                       mode_t              mode)
-{
-       int fd;
-       off_t size = 0;
-
-       const char * dot;
-       char fext[10];
-
-       if (!(flags & (O_CREAT|O_TRUNC))) {
-               /* Caller is not intending to rewrite the file. Let's not mess
-                * with the allocation in this case.
-                */
-               goto normal_open;
-       }
-
-       *fext = '\0';
-       dot = strrchr(smb_fname->base_name, '.');
-       if (dot && *++dot) {
-               if (strlen(dot) < sizeof(fext)) {
-                       strncpy(fext, dot, sizeof(fext));
-                       if (!strnorm(fext, CASE_LOWER)) {
-                               goto normal_open;
-                       }
-               }
-       }
-
-       if (*fext == '\0') {
-               goto normal_open;
-       }
-
-       /* Syntax for specifying preallocation size is:
-        *      MODULE: <extension> = <size>
-        * where
-        *      <extension> is the file extension in lower case
-        *      <size> is a size like 10, 10K, 10M
-        */
-       size = conv_str_size(lp_parm_const_string(SNUM(handle->conn), MODULE,
-                                                   fext, NULL));
-       if (size <= 0) {
-               /* No need to preallocate this file. */
-               goto normal_open;
-       }
-
-       fd = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       if (fd < 0) {
-               return fd;
-       }
-
-       /* Prellocate only if the file is being created or replaced. Note that
-        * Samba won't ever pass down O_TRUNC, which is why we have to handle
-        * truncate calls specially.
-        */
-       if ((flags & O_CREAT) || (flags & O_TRUNC)) {
-               off_t * psize;
-
-               psize = VFS_ADD_FSP_EXTENSION(handle, fsp, off_t, NULL);
-               if (psize == NULL || *psize == -1) {
-                       return fd;
-               }
-
-               DEBUG(module_debug,
-                       ("%s: preallocating %s (fd=%d) to %lld bytes\n",
-                           MODULE, smb_fname_str_dbg(smb_fname), fd,
-                           (long long)size));
-
-               *psize = size;
-               if (preallocate_space(fd, *psize) < 0) {
-                       VFS_REMOVE_FSP_EXTENSION(handle, fsp);
-               }
-       }
-
-       return fd;
-
-normal_open:
-       /* We are not creating or replacing a file. Skip the
-        * preallocation.
-        */
-       DEBUG(module_debug, ("%s: skipping preallocation for %s\n",
-               MODULE, smb_fname_str_dbg(smb_fname)));
-       return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-}
-
 static int prealloc_openat(struct vfs_handle_struct* handle,
                           const struct files_struct *dirfsp,
                           const struct smb_filename *smb_fname,
@@ -294,7 +208,6 @@ static int prealloc_ftruncate(vfs_handle_struct * handle,
 }
 
 static struct vfs_fn_pointers prealloc_fns = {
-       .open_fn = prealloc_open,
        .openat_fn = prealloc_openat,
        .ftruncate_fn = prealloc_ftruncate,
        .connect_fn = prealloc_connect,
index ade31ff4457493154a61bc921351a3970b5dcd73..dc68d138bad388d24c6c2a7036a7758327993133 100644 (file)
@@ -382,76 +382,6 @@ static bool preopen_parse_fname(const char *fname, unsigned long *pnum,
        return true;
 }
 
-static int preopen_open(vfs_handle_struct *handle,
-                       struct smb_filename *smb_fname, files_struct *fsp,
-                       int flags, mode_t mode)
-{
-       struct preopen_state *state;
-       int res;
-       unsigned long num;
-
-       DEBUG(10, ("preopen_open called on %s\n", smb_fname_str_dbg(smb_fname)));
-
-       state = preopen_state_get(handle);
-       if (state == NULL) {
-               return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       }
-
-       res = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       if (res == -1) {
-               return -1;
-       }
-
-       if ((flags & O_ACCMODE) != O_RDONLY) {
-               return res;
-       }
-
-       if (!is_in_path(smb_fname->base_name, state->preopen_names, true)) {
-               DEBUG(10, ("%s does not match the preopen:names list\n",
-                          smb_fname_str_dbg(smb_fname)));
-               return res;
-       }
-
-       TALLOC_FREE(state->template_fname);
-       state->template_fname = talloc_asprintf(
-               state, "%s/%s",
-               fsp->conn->cwd_fsp->fsp_name->base_name, smb_fname->base_name);
-
-       if (state->template_fname == NULL) {
-               return res;
-       }
-
-       if (!preopen_parse_fname(state->template_fname, &num,
-                                &state->number_start, &state->num_digits)) {
-               TALLOC_FREE(state->template_fname);
-               return res;
-       }
-
-       if (num > state->fnum_sent) {
-               /*
-                * Helpers were too slow, there's no point in reading
-                * files in helpers that we already read in the
-                * parent.
-                */
-               state->fnum_sent = num;
-       }
-
-       if ((state->fnum_queue_end != 0) /* Something was started earlier */
-           && (num < (state->fnum_queue_end - state->queue_max))) {
-               /*
-                * "num" is before the queue we announced. This means
-                * a new run is started.
-                */
-               state->fnum_sent = num;
-       }
-
-       state->fnum_queue_end = num + state->queue_max;
-
-       preopen_queue_run(state);
-
-       return res;
-}
-
 static int preopen_openat(struct vfs_handle_struct *handle,
                          const struct files_struct *dirfsp,
                          const struct smb_filename *smb_fname,
@@ -531,7 +461,6 @@ static int preopen_openat(struct vfs_handle_struct *handle,
 }
 
 static struct vfs_fn_pointers vfs_preopen_fns = {
-       .open_fn = preopen_open,
        .openat_fn = preopen_openat,
 };
 
index d9ac83b1ba7bb43fdc29d00ec91d311b7756dd54..4eb8257f1fc1e151224069c54a7bcd81c9a65309 100644 (file)
@@ -1318,69 +1318,6 @@ static int shadow_copy2_fstat(vfs_handle_struct *handle, files_struct *fsp,
        return ret;
 }
 
-static int shadow_copy2_open(vfs_handle_struct *handle,
-                            struct smb_filename *smb_fname, files_struct *fsp,
-                            int flags, mode_t mode)
-{
-       time_t timestamp = 0;
-       char *stripped = NULL;
-       char *tmp;
-       bool is_converted = false;
-       int saved_errno = 0;
-       int ret;
-
-       if (!shadow_copy2_strip_snapshot_converted(talloc_tos(), handle,
-                                        smb_fname,
-                                        &timestamp, &stripped,
-                                        &is_converted)) {
-               return -1;
-       }
-       if (timestamp == 0) {
-               if (is_converted) {
-                       /*
-                        * Just pave over the user requested mode and use
-                        * O_RDONLY. Later attempts by the client to write on
-                        * the handle will fail in the pwrite() syscall with
-                        * EINVAL which we carefully map to EROFS. In sum, this
-                        * matches Windows behaviour.
-                        */
-                       flags = O_RDONLY;
-               }
-               return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       }
-
-       tmp = smb_fname->base_name;
-       smb_fname->base_name = shadow_copy2_convert(
-               talloc_tos(), handle, stripped, timestamp);
-       TALLOC_FREE(stripped);
-
-       if (smb_fname->base_name == NULL) {
-               smb_fname->base_name = tmp;
-               return -1;
-       }
-
-       /*
-        * Just pave over the user requested mode and use O_RDONLY. Later
-        * attempts by the client to write on the handle will fail in the
-        * pwrite() syscall with EINVAL which we carefully map to EROFS. In sum,
-        * this matches Windows behaviour.
-        */
-       flags = O_RDONLY;
-
-       ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       if (ret == -1) {
-               saved_errno = errno;
-       }
-
-       TALLOC_FREE(smb_fname->base_name);
-       smb_fname->base_name = tmp;
-
-       if (saved_errno != 0) {
-               errno = saved_errno;
-       }
-       return ret;
-}
-
 static int shadow_copy2_openat(vfs_handle_struct *handle,
                               const struct files_struct *dirfsp,
                               const struct smb_filename *smb_fname_in,
@@ -3255,7 +3192,6 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
        .stat_fn = shadow_copy2_stat,
        .lstat_fn = shadow_copy2_lstat,
        .fstat_fn = shadow_copy2_fstat,
-       .open_fn = shadow_copy2_open,
        .openat_fn = shadow_copy2_openat,
        .unlinkat_fn = shadow_copy2_unlinkat,
        .chmod_fn = shadow_copy2_chmod,
index 20d2dd6d3698349270077ccd60b083fd54b0309b..8e78cb605c80ed2a9a7df7e3489fc8ee16351bac 100644 (file)
@@ -2073,43 +2073,6 @@ static int snapper_gmt_lstat(vfs_handle_struct *handle,
        return ret;
 }
 
-static int snapper_gmt_open(vfs_handle_struct *handle,
-                           struct smb_filename *smb_fname, files_struct *fsp,
-                           int flags, mode_t mode)
-{
-       time_t timestamp;
-       char *stripped, *tmp;
-       int ret, saved_errno;
-
-       if (!snapper_gmt_strip_snapshot(talloc_tos(), handle,
-                                       smb_fname,
-                                       &timestamp, &stripped)) {
-               return -1;
-       }
-       if (timestamp == 0) {
-               return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       }
-
-       tmp = smb_fname->base_name;
-       smb_fname->base_name = snapper_gmt_convert(talloc_tos(), handle,
-                                                  stripped, timestamp);
-       TALLOC_FREE(stripped);
-
-       if (smb_fname->base_name == NULL) {
-               smb_fname->base_name = tmp;
-               return -1;
-       }
-
-       ret = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       saved_errno = errno;
-
-       TALLOC_FREE(smb_fname->base_name);
-       smb_fname->base_name = tmp;
-
-       errno = saved_errno;
-       return ret;
-}
-
 static int snapper_gmt_openat(struct vfs_handle_struct *handle,
                              const struct files_struct *dirfsp,
                              const struct smb_filename *smb_fname_in,
@@ -2817,7 +2780,6 @@ static struct vfs_fn_pointers snapper_fns = {
        .symlinkat_fn = snapper_gmt_symlinkat,
        .stat_fn = snapper_gmt_stat,
        .lstat_fn = snapper_gmt_lstat,
-       .open_fn = snapper_gmt_open,
        .openat_fn = snapper_gmt_openat,
        .unlinkat_fn = snapper_gmt_unlinkat,
        .chmod_fn = snapper_gmt_chmod,
index 7a3402606d1514daa9de661967a59d12674a91b7..dca814f5df09f6267db76cfc8f63f8849b29c4b4 100644 (file)
@@ -614,53 +614,6 @@ static int streams_depot_lstat(vfs_handle_struct *handle,
        return ret;
 }
 
-static int streams_depot_open(vfs_handle_struct *handle,
-                             struct smb_filename *smb_fname,
-                             files_struct *fsp, int flags, mode_t mode)
-{
-       struct smb_filename *smb_fname_stream = NULL;
-       struct smb_filename *smb_fname_base = NULL;
-       NTSTATUS status;
-       int ret = -1;
-
-       if (!is_named_stream(smb_fname)) {
-               return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       }
-
-       /* Ensure the base file still exists. */
-       smb_fname_base = synthetic_smb_fname(talloc_tos(),
-                                       smb_fname->base_name,
-                                       NULL,
-                                       NULL,
-                                       smb_fname->twrp,
-                                       smb_fname->flags);
-       if (smb_fname_base == NULL) {
-               ret = -1;
-               errno = ENOMEM;
-               goto done;
-       }
-
-       ret = SMB_VFS_NEXT_STAT(handle, smb_fname_base);
-       if (ret == -1) {
-               goto done;
-       }
-
-       /* Determine the stream name, and then open it. */
-       status = stream_smb_fname(handle, smb_fname, &smb_fname_stream, true);
-       if (!NT_STATUS_IS_OK(status)) {
-               ret = -1;
-               errno = map_errno_from_nt_status(status);
-               goto done;
-       }
-
-       ret = SMB_VFS_NEXT_OPEN(handle, smb_fname_stream, fsp, flags, mode);
-
- done:
-       TALLOC_FREE(smb_fname_stream);
-       TALLOC_FREE(smb_fname_base);
-       return ret;
-}
-
 static int streams_depot_openat(struct vfs_handle_struct *handle,
                                const struct files_struct *dirfsp,
                                const struct smb_filename *smb_fname,
@@ -1167,7 +1120,6 @@ static uint32_t streams_depot_fs_capabilities(struct vfs_handle_struct *handle,
 
 static struct vfs_fn_pointers vfs_streams_depot_fns = {
        .fs_capabilities_fn = streams_depot_fs_capabilities,
-       .open_fn = streams_depot_open,
        .openat_fn = streams_depot_openat,
        .stat_fn = streams_depot_stat,
        .lstat_fn = streams_depot_lstat,
index 8e8f56a38403adeda95347bb9ed559b515473d5d..2e4105fec496ee76d79e8135f694fb20f28b6f08 100644 (file)
@@ -359,145 +359,6 @@ static int streams_xattr_lstat(vfs_handle_struct *handle,
        return result;
 }
 
-static int streams_xattr_open(vfs_handle_struct *handle,
-                             struct smb_filename *smb_fname,
-                             files_struct *fsp, int flags, mode_t mode)
-{
-       NTSTATUS status;
-       struct streams_xattr_config *config = NULL;
-       struct stream_io *sio = NULL;
-       struct ea_struct ea;
-       char *xattr_name = NULL;
-       int pipe_fds[2];
-       int fakefd = -1;
-       bool set_empty_xattr = false;
-       int ret;
-
-       SMB_VFS_HANDLE_GET_DATA(handle, config, struct streams_xattr_config,
-                               return -1);
-
-       DEBUG(10, ("streams_xattr_open called for %s with flags 0x%x\n",
-                  smb_fname_str_dbg(smb_fname), flags));
-
-       if (!is_named_stream(smb_fname)) {
-               return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       }
-
-       status = streams_xattr_get_name(handle, talloc_tos(),
-                                       smb_fname->stream_name, &xattr_name);
-       if (!NT_STATUS_IS_OK(status)) {
-               errno = map_errno_from_nt_status(status);
-               goto fail;
-       }
-
-       status = get_ea_value(talloc_tos(), handle->conn, NULL,
-                             smb_fname, xattr_name, &ea);
-
-       DEBUG(10, ("get_ea_value returned %s\n", nt_errstr(status)));
-
-       if (!NT_STATUS_IS_OK(status)) {
-               if (!NT_STATUS_EQUAL(status, NT_STATUS_NOT_FOUND)) {
-                       /*
-                        * The base file is not there. This is an error even if
-                        * we got O_CREAT, the higher levels should have created
-                        * the base file for us.
-                        */
-                       DBG_DEBUG("streams_xattr_open: base file %s not around, "
-                                 "returning ENOENT\n", smb_fname->base_name);
-                       errno = ENOENT;
-                       goto fail;
-               }
-
-               if (!(flags & O_CREAT)) {
-                       errno = ENOATTR;
-                       goto fail;
-               }
-
-               set_empty_xattr = true;
-       }
-
-       if (flags & O_TRUNC) {
-               set_empty_xattr = true;
-       }
-
-       if (set_empty_xattr) {
-               /*
-                * The attribute does not exist or needs to be truncated
-                */
-
-               /*
-                * Darn, xattrs need at least 1 byte
-                */
-               char null = '\0';
-
-               DEBUG(10, ("creating or truncating attribute %s on file %s\n",
-                          xattr_name, smb_fname->base_name));
-
-               ret = SMB_VFS_SETXATTR(fsp->conn,
-                                      smb_fname,
-                                      xattr_name,
-                                      &null, sizeof(null),
-                                      flags & O_EXCL ? XATTR_CREATE : 0);
-               if (ret != 0) {
-                       goto fail;
-               }
-       }
-
-       /*
-        * Return a valid fd, but ensure any attempt to use it returns an error
-        * (EPIPE).
-        */
-       ret = pipe(pipe_fds);
-       if (ret != 0) {
-               goto fail;
-       }
-
-       close(pipe_fds[1]);
-       pipe_fds[1] = -1;
-       fakefd = pipe_fds[0];
-
-        sio = VFS_ADD_FSP_EXTENSION(handle, fsp, struct stream_io, NULL);
-        if (sio == NULL) {
-                errno = ENOMEM;
-                goto fail;
-        }
-
-        sio->xattr_name = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
-                                       xattr_name);
-       if (sio->xattr_name == NULL) {
-               errno = ENOMEM;
-               goto fail;
-       }
-
-       /*
-        * so->base needs to be a copy of fsp->fsp_name->base_name,
-        * making it identical to streams_xattr_recheck(). If the
-        * open is changing directories, fsp->fsp_name->base_name
-        * will be the full path from the share root, whilst
-        * smb_fname will be relative to the $cwd.
-        */
-        sio->base = talloc_strdup(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
-                                 fsp->fsp_name->base_name);
-       if (sio->base == NULL) {
-               errno = ENOMEM;
-               goto fail;
-       }
-
-       sio->fsp_name_ptr = fsp->fsp_name;
-       sio->handle = handle;
-       sio->fsp = fsp;
-
-       return fakefd;
-
- fail:
-       if (fakefd >= 0) {
-               close(fakefd);
-               fakefd = -1;
-       }
-
-       return -1;
-}
-
 static int streams_xattr_openat(struct vfs_handle_struct *handle,
                                const struct files_struct *dirfsp,
                                const struct smb_filename *smb_fname,
@@ -1790,7 +1651,6 @@ static bool streams_xattr_strict_lock_check(struct vfs_handle_struct *handle,
 static struct vfs_fn_pointers vfs_streams_xattr_fns = {
        .fs_capabilities_fn = streams_xattr_fs_capabilities,
        .connect_fn = streams_xattr_connect,
-       .open_fn = streams_xattr_open,
        .openat_fn = streams_xattr_openat,
        .close_fn = streams_xattr_close,
        .stat_fn = streams_xattr_stat,
index 92ebd14a9453cad38232cfa37febf4d5dfec0d68..0ede0fd2bf9748c8cc1f48f278e0926511dd57d1 100644 (file)
@@ -221,15 +221,6 @@ static int syncops_linkat(vfs_handle_struct *handle,
        return ret;
 }
 
-
-static int syncops_open(vfs_handle_struct *handle,
-                       struct smb_filename *smb_fname, files_struct *fsp,
-                       int flags, mode_t mode)
-{
-       SYNCOPS_NEXT_SMB_FNAME(OPEN, (flags&O_CREAT?smb_fname:NULL),
-                              (handle, smb_fname, fsp, flags, mode));
-}
-
 static int syncops_openat(struct vfs_handle_struct *handle,
                          const struct files_struct *dirfsp,
                          const struct smb_filename *smb_fname,
@@ -336,7 +327,6 @@ static int syncops_connect(struct vfs_handle_struct *handle, const char *service
 static struct vfs_fn_pointers vfs_syncops_fns = {
        .connect_fn = syncops_connect,
        .mkdirat_fn = syncops_mkdirat,
-       .open_fn = syncops_open,
        .openat_fn = syncops_openat,
        .renameat_fn = syncops_renameat,
        .unlinkat_fn = syncops_unlinkat,
index d357eb2e43cf518ec6c4eb70fe2ed136590f5548..ff4952c45e7b624762227fcc1121987a4f0f5ef3 100644 (file)
@@ -584,27 +584,6 @@ static int smb_time_audit_closedir(vfs_handle_struct *handle,
        return result;
 }
 
-static int smb_time_audit_open(vfs_handle_struct *handle,
-                              struct smb_filename *fname,
-                              files_struct *fsp,
-                              int flags, mode_t mode)
-{
-       int result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_OPEN(handle, fname, fsp, flags, mode);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_fsp("open", timediff, fsp);
-       }
-
-       return result;
-}
-
 static int smb_time_audit_openat(vfs_handle_struct *handle,
                                 const struct files_struct *dirfsp,
                                 const struct smb_filename *smb_fname,
@@ -2884,7 +2863,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .rewind_dir_fn = smb_time_audit_rewinddir,
        .mkdirat_fn = smb_time_audit_mkdirat,
        .closedir_fn = smb_time_audit_closedir,
-       .open_fn = smb_time_audit_open,
        .openat_fn = smb_time_audit_openat,
        .create_file_fn = smb_time_audit_create_file,
        .close_fn = smb_time_audit_close,
index bffa60b718132421e19bba78c33a8757ab266b54..b755621208b442c5661f6417181384b6fd7ca5df 100644 (file)
@@ -780,50 +780,6 @@ static int um_closedir(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_CLOSEDIR(handle, realdirp);
 }
 
-static int um_open(vfs_handle_struct *handle,
-                  struct smb_filename *smb_fname,
-                  files_struct *fsp,
-                  int flags,
-                  mode_t mode)
-{
-       int ret;
-       struct smb_filename *client_fname = NULL;
-
-       DEBUG(10, ("Entering with smb_fname->base_name '%s'\n",
-                             smb_fname->base_name));
-
-       if (!is_in_media_files(smb_fname->base_name)) {
-               return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-       }
-
-       if (alloc_get_client_smb_fname(handle, talloc_tos(),
-                                      smb_fname,
-                                      &client_fname)) {
-               ret = -1;
-               goto err;
-       }
-
-       /*
-        * FIXME:
-        * What about fsp->fsp_name?  We also have to get correct stat
-        * info into fsp and smb_fname for DB files, don't we?
-        */
-
-       DEBUG(10, ("Leaving with smb_fname->base_name '%s' "
-                  "smb_fname->st.st_ex_mtime %s"
-                  "fsp->fsp_name->st.st_ex_mtime %s",
-                             smb_fname->base_name,
-                             ctime(&(smb_fname->st.st_ex_mtime.tv_sec)),
-                             ctime(&(fsp->fsp_name->st.st_ex_mtime.tv_sec))));
-
-       ret = SMB_VFS_NEXT_OPEN(handle, client_fname, fsp, flags, mode);
-err:
-       TALLOC_FREE(client_fname);
-       DEBUG(10, ("Leaving with smb_fname->base_name '%s'\n",
-                             smb_fname->base_name));
-       return ret;
-}
-
 static int um_openat(struct vfs_handle_struct *handle,
                     const struct files_struct *dirfsp,
                     const struct smb_filename *smb_fname,
@@ -1893,7 +1849,6 @@ static struct vfs_fn_pointers vfs_um_fns = {
 
        /* File operations */
 
-       .open_fn = um_open,
        .openat_fn = um_openat,
        .create_file_fn = um_create_file,
        .renameat_fn = um_renameat,
index bf7f25d181fa12383a5e3c5dd64ca8ccaf8cb87a..fed1723a782541feab3210fa977a66bfc38e4662 100644 (file)
@@ -1145,173 +1145,6 @@ virusfilter_scan_return:
        return scan_result;
 }
 
-static int virusfilter_vfs_open(
-       struct vfs_handle_struct *handle,
-       struct smb_filename *smb_fname,
-       files_struct *fsp,
-       int flags,
-       mode_t mode)
-{
-       TALLOC_CTX *mem_ctx = talloc_tos();
-       struct virusfilter_config *config;
-       const char *cwd_fname = fsp->conn->cwd_fsp->fsp_name->base_name;
-       virusfilter_result scan_result;
-       const char *fname = fsp->fsp_name->base_name;
-       char *dir_name = NULL;
-       const char *base_name = NULL;
-       int scan_errno = 0;
-       size_t test_prefix;
-       size_t test_suffix;
-       int rename_trap_count = 0;
-       int ret;
-       bool ok1;
-       char *sret = NULL;
-
-       SMB_VFS_HANDLE_GET_DATA(handle, config,
-                               struct virusfilter_config, return -1);
-
-       if (fsp->fsp_flags.is_directory) {
-               DBG_INFO("Not scanned: Directory: %s/\n", cwd_fname);
-               goto virusfilter_vfs_open_next;
-       }
-
-       test_prefix = strlen(config->rename_prefix);
-       test_suffix = strlen(config->rename_suffix);
-       if (test_prefix > 0) {
-               rename_trap_count++;
-       }
-       if (test_suffix > 0) {
-               rename_trap_count++;
-       }
-
-       if (is_named_stream(smb_fname)) {
-               DBG_INFO("Not scanned: only file backed streams can be scanned:"
-                        " %s/%s\n", cwd_fname, fname);
-               goto virusfilter_vfs_open_next;
-       }
-
-       if (!config->scan_on_open) {
-               DBG_INFO("Not scanned: scan on open is disabled: %s/%s\n",
-                        cwd_fname, fname);
-               goto virusfilter_vfs_open_next;
-       }
-
-       if (flags & O_TRUNC) {
-               DBG_INFO("Not scanned: Open flags have O_TRUNC: %s/%s\n",
-                        cwd_fname, fname);
-               goto virusfilter_vfs_open_next;
-       }
-
-       ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
-       if (ret != 0) {
-
-               /*
-                * Do not return immediately if !(flags & O_CREAT) &&
-                * errno != ENOENT.
-                * Do not do this here or anywhere else. The module is
-                * stackable and there may be modules below, such as audit
-                * modules, which should be handled.
-                */
-               goto virusfilter_vfs_open_next;
-       }
-       ret = S_ISREG(smb_fname->st.st_ex_mode);
-       if (ret == 0) {
-               DBG_INFO("Not scanned: Directory or special file: %s/%s\n",
-                        cwd_fname, fname);
-               goto virusfilter_vfs_open_next;
-       }
-       if (config->max_file_size > 0 &&
-           smb_fname->st.st_ex_size > config->max_file_size)
-       {
-               DBG_INFO("Not scanned: file size > max file size: %s/%s\n",
-                        cwd_fname, fname);
-               goto virusfilter_vfs_open_next;
-       }
-       if (config->min_file_size > 0 &&
-           smb_fname->st.st_ex_size < config->min_file_size)
-       {
-               DBG_INFO("Not scanned: file size < min file size: %s/%s\n",
-                     cwd_fname, fname);
-               goto virusfilter_vfs_open_next;
-       }
-
-       ok1 = is_in_path(fname, config->exclude_files, false);
-       if (config->exclude_files && ok1)
-       {
-               DBG_INFO("Not scanned: exclude files: %s/%s\n",
-                        cwd_fname, fname);
-               goto virusfilter_vfs_open_next;
-       }
-
-       if (config->infected_file_action == VIRUSFILTER_ACTION_QUARANTINE) {
-               sret = strstr_m(fname, config->quarantine_dir);
-               if (sret != NULL) {
-                       scan_errno = config->infected_open_errno;
-                       goto virusfilter_vfs_open_fail;
-               }
-       }
-
-       if (test_prefix > 0 || test_suffix > 0) {
-               ok1 = parent_dirname(mem_ctx, fname, &dir_name, &base_name);
-               if (ok1)
-               {
-                       if (test_prefix > 0) {
-                               ret = strncmp(base_name,
-                                   config->rename_prefix, test_prefix);
-                               if (ret != 0) {
-                                       test_prefix = 0;
-                               }
-                       }
-                       if (test_suffix > 0) {
-                               ret = strcmp(base_name + (strlen(base_name)
-                                                - test_suffix),
-                                                config->rename_suffix);
-                               if (ret != 0) {
-                                       test_suffix = 0;
-                               }
-                       }
-
-                       TALLOC_FREE(dir_name);
-
-                       if ((rename_trap_count == 2 && test_prefix &&
-                           test_suffix) || (rename_trap_count == 1 &&
-                           (test_prefix || test_suffix)))
-                       {
-                               scan_errno =
-                                       config->infected_open_errno;
-                               goto virusfilter_vfs_open_fail;
-                       }
-               }
-       }
-
-       scan_result = virusfilter_scan(handle, config, fsp);
-
-       switch (scan_result) {
-       case VIRUSFILTER_RESULT_CLEAN:
-               break;
-       case VIRUSFILTER_RESULT_INFECTED:
-               scan_errno = config->infected_open_errno;
-               goto virusfilter_vfs_open_fail;
-       case VIRUSFILTER_RESULT_ERROR:
-               if (config->block_access_on_error) {
-                       DBG_INFO("Block access\n");
-                       scan_errno = config->scan_error_open_errno;
-                       goto virusfilter_vfs_open_fail;
-               }
-               break;
-       default:
-               scan_errno = config->scan_error_open_errno;
-               goto virusfilter_vfs_open_fail;
-       }
-
-virusfilter_vfs_open_next:
-       return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-
-virusfilter_vfs_open_fail:
-       errno = (scan_errno != 0) ? scan_errno : EACCES;
-       return -1;
-}
-
 static int virusfilter_vfs_openat(struct vfs_handle_struct *handle,
                                  const struct files_struct *dirfsp,
                                  const struct smb_filename *smb_fname_in,
@@ -1697,7 +1530,6 @@ static int virusfilter_vfs_renameat(
 static struct vfs_fn_pointers vfs_virusfilter_fns = {
        .connect_fn     = virusfilter_vfs_connect,
        .disconnect_fn  = virusfilter_vfs_disconnect,
-       .open_fn        = virusfilter_vfs_open,
        .openat_fn      = virusfilter_vfs_openat,
        .close_fn       = virusfilter_vfs_close,
        .unlinkat_fn    = virusfilter_vfs_unlinkat,
index 5267c8b218eea16cf9bdc6bda89e3eac6fbe1525..ea3b519eb85a94977e3ee5e8840819325a39e3ca 100644 (file)
@@ -338,56 +338,6 @@ static int widelinks_lstat(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_STAT(handle, smb_fname);
 }
 
-static int widelinks_open(vfs_handle_struct *handle,
-                       struct smb_filename *smb_fname,
-                       files_struct *fsp,
-                       int flags,
-                       mode_t mode)
-{
-       struct widelinks_config *config = NULL;
-
-       SMB_VFS_HANDLE_GET_DATA(handle,
-                               config,
-                               struct widelinks_config,
-                               return -1);
-
-       if (!config->active) {
-               /* Module not active. */
-               return SMB_VFS_NEXT_OPEN(handle,
-                               smb_fname,
-                               fsp,
-                               flags,
-                               mode);
-       }
-
-       if (config->cwd == NULL) {
-               /* open before chdir. See note 1b above. */
-               return SMB_VFS_NEXT_OPEN(handle,
-                               smb_fname,
-                               fsp,
-                               flags,
-                               mode);
-       }
-
-       if (smb_fname->flags & SMB_FILENAME_POSIX_PATH) {
-               /* POSIX sees symlinks. */
-               return SMB_VFS_NEXT_OPEN(handle,
-                               smb_fname,
-                               fsp,
-                               flags,
-                               mode);
-       }
-
-       /* Remove O_NOFOLLOW. */
-       flags = (flags & ~O_NOFOLLOW);
-
-       return SMB_VFS_NEXT_OPEN(handle,
-                       smb_fname,
-                       fsp,
-                       flags,
-                       mode);
-}
-
 static int widelinks_openat(vfs_handle_struct *handle,
                            const struct files_struct *dirfsp,
                            const struct smb_filename *smb_fname,
@@ -457,7 +407,6 @@ static struct dirent *widelinks_readdir(vfs_handle_struct *handle,
 static struct vfs_fn_pointers vfs_widelinks_fns = {
        .connect_fn = widelinks_connect,
 
-       .open_fn = widelinks_open,
        .openat_fn = widelinks_openat,
        .lstat_fn = widelinks_lstat,
        /*
index c9c8e9ceb59e21f746bef686b15abd6bf4c22cb2..58e3e3c7c9257fa4288a1a0e2eb38bca2702d189 100644 (file)
@@ -492,56 +492,6 @@ static bool xattr_tdb_init(int snum, TALLOC_CTX *mem_ctx, struct db_context **p_
        return true;
 }
 
-static int xattr_tdb_open(vfs_handle_struct *handle,
-                       struct smb_filename *smb_fname,
-                       files_struct *fsp,
-                       int flags,
-                       mode_t mode)
-{
-       struct db_context *db = NULL;
-       TALLOC_CTX *frame = NULL;
-       int ret;
-
-       fsp->fh->fd = SMB_VFS_NEXT_OPEN(handle,
-                               smb_fname, fsp,
-                               flags,
-                               mode);
-
-       if (fsp->fh->fd < 0) {
-               return fsp->fh->fd;
-       }
-
-       if ((flags & (O_CREAT|O_EXCL)) != (O_CREAT|O_EXCL)) {
-               return fsp->fh->fd;
-       }
-
-       /*
-        * We know we used O_CREAT|O_EXCL and it worked.
-        * We must have created the file.
-        */
-
-       ret = SMB_VFS_FSTAT(fsp, &smb_fname->st);
-       if (ret == -1) {
-               /* Can't happen... */
-               DBG_WARNING("SMB_VFS_FSTAT failed on file %s (%s)\n",
-                       smb_fname_str_dbg(smb_fname),
-                       strerror(errno));
-               return -1;
-       }
-       fsp->file_id = SMB_VFS_FILE_ID_CREATE(fsp->conn, &smb_fname->st);
-
-       frame = talloc_stackframe();
-       SMB_VFS_HANDLE_GET_DATA(handle, db, struct db_context,
-                               if (!xattr_tdb_init(-1, frame, &db))
-                               {
-                                       TALLOC_FREE(frame); return -1;
-                               });
-
-       xattr_tdb_remove_all_attrs(db, &fsp->file_id);
-       TALLOC_FREE(frame);
-       return fsp->fh->fd;
-}
-
 static int xattr_tdb_openat(struct vfs_handle_struct *handle,
                            const struct files_struct *dirfsp,
                            const struct smb_filename *smb_fname,
@@ -776,7 +726,6 @@ static struct vfs_fn_pointers vfs_xattr_tdb_fns = {
        .flistxattr_fn = xattr_tdb_flistxattr,
        .removexattr_fn = xattr_tdb_removexattr,
        .fremovexattr_fn = xattr_tdb_fremovexattr,
-       .open_fn = xattr_tdb_open,
        .openat_fn = xattr_tdb_openat,
        .mkdirat_fn = xattr_tdb_mkdirat,
        .unlinkat_fn = xattr_tdb_unlinkat,
index 8a92744a85c50d5a575437393d1b851dd0c58b37..437934d1cd7c1da65a876a88516bee131591b617 100755 (executable)
@@ -41,8 +41,7 @@ exec 100>smbclient-stdin 101<smbclient-stdout 102<smbclient-stderr
 head -n 1 <&101
 head -n 1 <&102
 
-echo "error_inject:open = EINTR" > ${error_inject_conf}
-echo "error_inject:openat = EINTR" >> ${error_inject_conf}
+echo "error_inject:openat = EINTR" > ${error_inject_conf}
 ${SMBCONTROL} ${CONF} 0 reload-config
 
 sleep 1
index ae82dd871c5458a7aa3c1e19beb7388f2a88f459..849ee6f6523388d993e9559de8e9b34befb1854b 100644 (file)
@@ -1747,14 +1747,6 @@ int smb_vfs_call_closedir(struct vfs_handle_struct *handle,
        return handle->fns->closedir_fn(handle, dir);
 }
 
-int smb_vfs_call_open(struct vfs_handle_struct *handle,
-                     struct smb_filename *smb_fname, struct files_struct *fsp,
-                     int flags, mode_t mode)
-{
-       VFS_FIND(open);
-       return handle->fns->open_fn(handle, smb_fname, fsp, flags, mode);
-}
-
 int smb_vfs_call_openat(struct vfs_handle_struct *handle,
                        const struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,