]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: remove SMB_VFS_OPENDIR()
authorRalph Boehme <slow@samba.org>
Mon, 23 Mar 2020 09:44:08 +0000 (10:44 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 24 Mar 2020 21:23:43 +0000 (21:23 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 24 21:23:43 UTC 2020 on sn-devel-184

22 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
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_default.c
source3/modules/vfs_dirsort.c
source3/modules/vfs_extd_audit.c
source3/modules/vfs_full_audit.c
source3/modules/vfs_glusterfs.c
source3/modules/vfs_media_harmony.c
source3/modules/vfs_not_implemented.c
source3/modules/vfs_shadow_copy.c
source3/modules/vfs_shadow_copy2.c
source3/modules/vfs_snapper.c
source3/modules/vfs_time_audit.c
source3/modules/vfs_unityed_media.c
source3/smbd/vfs.c

index c1b5923b7523db35a8fae4ef0d258694715aa116..ed9f108009e56c6707c58e13c66ec6f030345bd9 100644 (file)
@@ -122,14 +122,6 @@ static NTSTATUS skel_read_dfs_pathat(struct vfs_handle_struct *handle,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-static DIR *skel_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       return NULL;
-}
-
 static NTSTATUS skel_snap_check_path(struct vfs_handle_struct *handle,
                                     TALLOC_CTX *mem_ctx,
                                     const char *service_path,
@@ -1059,7 +1051,6 @@ static struct vfs_fn_pointers skel_opaque_fns = {
 
        /* Directory operations */
 
-       .opendir_fn = skel_opendir,
        .fdopendir_fn = skel_fdopendir,
        .readdir_fn = skel_readdir,
        .seekdir_fn = skel_seekdir,
index d2d05673fb439725d63d1d89a649282520f27b28..1dce543734f8db51b4d6fa2c9040fbe4f80d265f 100644 (file)
@@ -128,14 +128,6 @@ static NTSTATUS skel_read_dfs_pathat(struct vfs_handle_struct *handle,
                                        preferral_count);
 }
 
-static DIR *skel_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       return SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
-}
-
 static NTSTATUS skel_snap_check_path(struct vfs_handle_struct *handle,
                                     TALLOC_CTX *mem_ctx,
                                     const char *service_path,
@@ -1366,7 +1358,6 @@ static struct vfs_fn_pointers skel_transparent_fns = {
 
        /* Directory operations */
 
-       .opendir_fn = skel_opendir,
        .fdopendir_fn = skel_fdopendir,
        .readdir_fn = skel_readdir,
        .seekdir_fn = skel_seekdir,
index 85da21513fc836dbf792e2ce6702b12388fef3e9..bda6cde3fdc6199f7cdd3355967ab529a2f55545 100644 (file)
 /* Version 42 - Add SMB_VFS_READ_DFS_PATHAT() */
 /* Change to Version 43 - will ship with 4.13. */
 /* Version 43 - Remove deferred_close from struct files_struct */
+/* Version 43 - Remove SMB_VFS_OPENDIR() */
 
 #define SMB_VFS_INTERFACE_VERSION 43
 
@@ -719,10 +720,6 @@ struct vfs_fn_pointers {
 
        /* Directory operations */
 
-       DIR *(*opendir_fn)(struct vfs_handle_struct *handle,
-                                       const struct smb_filename *smb_fname,
-                                       const char *mask,
-                                       uint32_t attributes);
        DIR *(*fdopendir_fn)(struct vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32_t attributes);
        struct dirent *(*readdir_fn)(struct vfs_handle_struct *handle,
                                         DIR *dirp,
@@ -1230,10 +1227,6 @@ NTSTATUS smb_vfs_call_read_dfs_pathat(struct vfs_handle_struct *handle,
                                const struct smb_filename *smb_fname,
                                struct referral **ppreflist,
                                size_t *preferral_count);
-DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attributes);
 DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
                                        struct files_struct *fsp,
                                        const char *mask,
@@ -1678,10 +1671,6 @@ NTSTATUS vfs_not_implemented_read_dfs_pathat(struct vfs_handle_struct *handle,
                                const struct smb_filename *smb_fname,
                                struct referral **ppreflist,
                                size_t *preferral_count);
-DIR *vfs_not_implemented_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr);
 NTSTATUS vfs_not_implemented_snap_check_path(struct vfs_handle_struct *handle,
                                TALLOC_CTX *mem_ctx,
                                const char *service_path,
index 112169ab83b81b08a6391596bee5ebb2d96e8639..c8c41cd62f56d1674ff0cbea2c70488f8d131a4b 100644 (file)
                 (pcount))
 
 /* Directory operations */
-#define SMB_VFS_OPENDIR(conn, smb_fname, mask, attr) \
-       smb_vfs_call_opendir((conn)->vfs_handles, (smb_fname), (mask), (attr))
-#define SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr) \
-       smb_vfs_call_opendir((handle)->next, (smb_fname), (mask), (attr))
-
 #define SMB_VFS_FDOPENDIR(fsp, mask, attr) \
        smb_vfs_call_fdopendir((fsp)->conn->vfs_handles, (fsp), (mask), (attr))
 #define SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr) \
index 84640b2bfa9c543f6ca1d217c88904f148dd0b78..916d8a04206d7bdf5654ee61c8e4f35ef595af40 100644 (file)
@@ -177,23 +177,6 @@ static void audit_disconnect(vfs_handle_struct *handle)
        return;
 }
 
-static DIR *audit_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       DIR *result;
-       
-       result = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
-
-       syslog(audit_syslog_priority(handle), "opendir %s %s%s\n",
-              smb_fname->base_name,
-              (result == NULL) ? "failed: " : "",
-              (result == NULL) ? strerror(errno) : "");
-
-       return result;
-}
-
 static int audit_mkdirat(vfs_handle_struct *handle,
                struct files_struct *dirfsp,
                const struct smb_filename *smb_fname,
@@ -321,7 +304,6 @@ static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mod
 static struct vfs_fn_pointers vfs_audit_fns = {
        .connect_fn = audit_connect,
        .disconnect_fn = audit_disconnect,
-       .opendir_fn = audit_opendir,
        .mkdirat_fn = audit_mkdirat,
        .open_fn = audit_open,
        .close_fn = audit_close,
index e67cb750e0fa4557d8ac753008d32c2f0fae910b..d9c741dd1f89029dfe68b7c04d12c04a6d3c7ed6 100644 (file)
@@ -82,31 +82,6 @@ static int cap_get_quota(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_GET_QUOTA(handle, cap_smb_fname, qtype, id, dq);
 }
 
-static DIR *cap_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       char *capname = capencode(talloc_tos(), smb_fname->base_name);
-       struct smb_filename *cap_smb_fname = NULL;
-
-       if (!capname) {
-               errno = ENOMEM;
-               return NULL;
-       }
-       cap_smb_fname = synthetic_smb_fname(talloc_tos(),
-                                       capname,
-                                       NULL,
-                                       NULL,
-                                       smb_fname->flags);
-       if (cap_smb_fname == NULL) {
-               TALLOC_FREE(capname);
-               errno = ENOMEM;
-               return NULL;
-       }
-       return SMB_VFS_NEXT_OPENDIR(handle, cap_smb_fname, mask, attr);
-}
-
 static struct dirent *cap_readdir(vfs_handle_struct *handle,
                                      DIR *dirp,
                                      SMB_STRUCT_STAT *sbuf)
@@ -1046,7 +1021,6 @@ static NTSTATUS cap_read_dfs_pathat(struct vfs_handle_struct *handle,
 static struct vfs_fn_pointers vfs_cap_fns = {
        .disk_free_fn = cap_disk_free,
        .get_quota_fn = cap_get_quota,
-       .opendir_fn = cap_opendir,
        .readdir_fn = cap_readdir,
        .mkdirat_fn = cap_mkdirat,
        .open_fn = cap_open,
index 5bb55cf89f602cc77621ae6f294dc09a2979c34b..e90adaa2d460215630aed523cc03090f71169599 100644 (file)
@@ -171,44 +171,6 @@ static int catia_connect(struct vfs_handle_struct *handle,
        return SMB_VFS_NEXT_CONNECT(handle, service, user);
 }
 
-static DIR *catia_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       char *name_mapped = NULL;
-       NTSTATUS status;
-       DIR *ret;
-       struct smb_filename *mapped_smb_fname = NULL;
-
-       status = catia_string_replace_allocate(handle->conn,
-                               smb_fname->base_name,
-                               &name_mapped,
-                               vfs_translate_to_unix);
-       if (!NT_STATUS_IS_OK(status)) {
-               errno = map_errno_from_nt_status(status);
-               return NULL;
-       }
-
-       mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
-                               name_mapped,
-                               NULL,
-                               &smb_fname->st,
-                               smb_fname->flags);
-       if (mapped_smb_fname == NULL) {
-               TALLOC_FREE(mapped_smb_fname);
-               errno = ENOMEM;
-               return NULL;
-       }
-
-       ret = SMB_VFS_NEXT_OPENDIR(handle, mapped_smb_fname, mask, attr);
-
-       TALLOC_FREE(name_mapped);
-       TALLOC_FREE(mapped_smb_fname);
-
-       return ret;
-}
-
 /*
  * TRANSLATE_NAME call which converts the given name to
  * "WINDOWS displayable" name
@@ -2450,7 +2412,6 @@ static struct vfs_fn_pointers vfs_catia_fns = {
 
        /* Directory operations */
        .mkdirat_fn = catia_mkdirat,
-       .opendir_fn = catia_opendir,
        .readdir_attr_fn = catia_readdir_attr,
 
        /* File operations */
index 76393a84152e60035606934bd47c5ea6bf2284c2..7f4d65d4871899806fa13a9ab6321533e04a4049 100644 (file)
@@ -301,25 +301,6 @@ static uint32_t cephwrap_fs_capabilities(struct vfs_handle_struct *handle,
 
 /* Directory operations */
 
-static DIR *cephwrap_opendir(struct vfs_handle_struct *handle,
-                            const struct smb_filename *smb_fname,
-                            const char *mask, uint32_t attr)
-{
-       int ret = 0;
-       struct ceph_dir_result *result;
-       DBG_DEBUG("[CEPH] opendir(%p, %s)\n", handle, smb_fname->base_name);
-
-       /* Returns NULL if it does not exist or there are problems ? */
-       ret = ceph_opendir(handle->data, smb_fname->base_name, &result);
-       if (ret < 0) {
-               result = NULL;
-               errno = -ret; /* We return result which is NULL in this case */
-       }
-
-       DBG_DEBUG("[CEPH] opendir(...) = %d\n", ret);
-       return (DIR *) result;
-}
-
 static DIR *cephwrap_fdopendir(struct vfs_handle_struct *handle,
                               struct files_struct *fsp,
                               const char *mask,
@@ -1443,7 +1424,6 @@ static struct vfs_fn_pointers ceph_fns = {
 
        /* Directory operations */
 
-       .opendir_fn = cephwrap_opendir,
        .fdopendir_fn = cephwrap_fdopendir,
        .readdir_fn = cephwrap_readdir,
        .seekdir_fn = cephwrap_seekdir,
index 7ff1c60a402cfb9655947bc8b06917b076af8037..7af9ff655c127d55fd6b97350c7c1f2b25363d32 100644 (file)
@@ -720,53 +720,6 @@ static int ceph_snap_gmt_convert(struct vfs_handle_struct *handle,
        return 0;
 }
 
-static DIR *ceph_snap_gmt_opendir(vfs_handle_struct *handle,
-                               const struct smb_filename *csmb_fname,
-                               const char *mask,
-                               uint32_t attr)
-{
-       time_t timestamp = 0;
-       char stripped[PATH_MAX + 1];
-       int ret;
-       DIR *dir;
-       int saved_errno;
-       struct smb_filename *conv_smb_fname = NULL;
-       char conv[PATH_MAX + 1];
-
-       ret = ceph_snap_gmt_strip_snapshot(handle,
-                       csmb_fname->base_name,
-                       &timestamp,
-                       stripped, sizeof(stripped));
-       if (ret < 0) {
-               errno = -ret;
-               return NULL;
-       }
-       if (timestamp == 0) {
-               return SMB_VFS_NEXT_OPENDIR(handle, csmb_fname, mask, attr);
-       }
-       ret = ceph_snap_gmt_convert_dir(handle, stripped,
-                                       timestamp, conv, sizeof(conv));
-       if (ret < 0) {
-               errno = -ret;
-               return NULL;
-       }
-       conv_smb_fname = synthetic_smb_fname(talloc_tos(),
-                                       conv,
-                                       NULL,
-                                       NULL,
-                                       csmb_fname->flags);
-       if (conv_smb_fname == NULL) {
-               errno = ENOMEM;
-               return NULL;
-       }
-
-       dir = SMB_VFS_NEXT_OPENDIR(handle, conv_smb_fname, mask, attr);
-       saved_errno = errno;
-       TALLOC_FREE(conv_smb_fname);
-       errno = saved_errno;
-       return dir;
-}
-
 static int ceph_snap_gmt_renameat(vfs_handle_struct *handle,
                        files_struct *srcfsp,
                        const struct smb_filename *smb_fname_src,
@@ -1601,7 +1554,6 @@ static int ceph_snap_gmt_get_quota(vfs_handle_struct *handle,
 
 static struct vfs_fn_pointers ceph_snap_fns = {
        .get_shadow_copy_data_fn = ceph_snap_get_shadow_copy_data,
-       .opendir_fn = ceph_snap_gmt_opendir,
        .disk_free_fn = ceph_snap_gmt_disk_free,
        .get_quota_fn = ceph_snap_gmt_get_quota,
        .renameat_fn = ceph_snap_gmt_renameat,
index a30f3ba1d31646e66c8c45eb933c892489ab69b3..ca1f000143a6280b32c38f1e63a5d4e39d74bddb 100644 (file)
@@ -535,19 +535,6 @@ static NTSTATUS vfswrap_snap_delete(struct vfs_handle_struct *handle,
 
 /* Directory operations */
 
-static DIR *vfswrap_opendir(vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *mask,
-                               uint32_t attr)
-{
-       DIR *result;
-
-       START_PROFILE(syscall_opendir);
-       result = opendir(smb_fname->base_name);
-       END_PROFILE(syscall_opendir);
-       return result;
-}
-
 static DIR *vfswrap_fdopendir(vfs_handle_struct *handle,
                        files_struct *fsp,
                        const char *mask,
@@ -3653,7 +3640,6 @@ static struct vfs_fn_pointers vfs_default_fns = {
 
        /* Directory operations */
 
-       .opendir_fn = vfswrap_opendir,
        .fdopendir_fn = vfswrap_fdopendir,
        .readdir_fn = vfswrap_readdir,
        .readdir_attr_fn = vfswrap_readdir_attr,
index c6b5ea41c93660336068f9d98d9464243663f5c3..f43a5f0b98aeabc4d33b777c3e3f6670939771ea 100644 (file)
@@ -130,67 +130,6 @@ static bool open_and_sort_dir(vfs_handle_struct *handle,
        return true;
 }
 
-static DIR *dirsort_opendir(vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *mask,
-                               uint32_t attr)
-{
-       struct dirsort_privates *list_head = NULL;
-       struct dirsort_privates *data = NULL;
-
-       if (SMB_VFS_HANDLE_TEST_DATA(handle)) {
-               /* Find the list head of all open directories. */
-               SMB_VFS_HANDLE_GET_DATA(handle, list_head, struct dirsort_privates,
-                               return NULL);
-       }
-
-       /* set up our private data about this directory */
-       data = talloc_zero(handle->conn, struct dirsort_privates);
-       if (!data) {
-               return NULL;
-       }
-
-       data->smb_fname = cp_smb_filename(data, smb_fname);
-       if (data->smb_fname == NULL) {
-               TALLOC_FREE(data);
-               return NULL;
-       }
-
-       if (ISDOT(data->smb_fname->base_name)) {
-               struct smb_filename *cwd_fname = vfs_GetWd(data, handle->conn);
-               if (cwd_fname == NULL) {
-                       TALLOC_FREE(data);
-                       return NULL;
-               }
-               TALLOC_FREE(data->smb_fname->base_name);
-               data->smb_fname->base_name = talloc_move(data->smb_fname,
-                                               &cwd_fname->base_name);
-               TALLOC_FREE(cwd_fname);
-       }
-
-       /* Open the underlying directory and count the number of entries */
-       data->source_directory = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask,
-                                                     attr);
-
-       if (data->source_directory == NULL) {
-               TALLOC_FREE(data);
-               return NULL;
-       }
-
-       if (!open_and_sort_dir(handle, data)) {
-               SMB_VFS_NEXT_CLOSEDIR(handle,data->source_directory);
-               TALLOC_FREE(data);
-               return NULL;
-       }
-
-       /* Add to the private list of all open directories. */
-       DLIST_ADD(list_head, data);
-       SMB_VFS_HANDLE_SET_DATA(handle, list_head, NULL,
-                               struct dirsort_privates, return NULL);
-
-       return data->source_directory;
-}
-
 static DIR *dirsort_fdopendir(vfs_handle_struct *handle,
                                        files_struct *fsp,
                                        const char *mask,
@@ -380,7 +319,6 @@ static int dirsort_closedir(vfs_handle_struct *handle, DIR *dirp)
 }
 
 static struct vfs_fn_pointers vfs_dirsort_fns = {
-       .opendir_fn = dirsort_opendir,
        .fdopendir_fn = dirsort_fdopendir,
        .readdir_fn = dirsort_readdir,
        .seekdir_fn = dirsort_seekdir,
index 97b072f00de7cca9ff952e0599b0c4b2880cba5d..b8cb5d54e6c32e15954a05f9bfeb76cc89d29326 100644 (file)
@@ -187,29 +187,6 @@ static void audit_disconnect(vfs_handle_struct *handle)
        return;
 }
 
-static DIR *audit_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       DIR *result;
-
-       result = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
-
-       if (lp_syslog() > 0) {
-               syslog(audit_syslog_priority(handle), "opendir %s %s%s\n",
-                      smb_fname->base_name,
-                      (result == NULL) ? "failed: " : "",
-                      (result == NULL) ? strerror(errno) : "");
-       }
-       DEBUG(1, ("vfs_extd_audit: opendir %s %s %s\n",
-              smb_fname->base_name,
-              (result == NULL) ? "failed: " : "",
-              (result == NULL) ? strerror(errno) : ""));
-
-       return result;
-}
-
 static int audit_mkdirat(vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
                        const struct smb_filename *smb_fname,
@@ -380,7 +357,6 @@ static int audit_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mod
 static struct vfs_fn_pointers vfs_extd_audit_fns = {
        .connect_fn = audit_connect,
        .disconnect_fn = audit_disconnect,
-       .opendir_fn = audit_opendir,
        .mkdirat_fn = audit_mkdirat,
        .open_fn = audit_open,
        .close_fn = audit_close,
index 5c8267dea9f4b275ec784c796c2b208b95a9ba81..1ea58a0ffab0bed0e991228de9e530224c75573a 100644 (file)
@@ -106,7 +106,6 @@ typedef enum _vfs_op_type {
 
        /* Directory operations */
 
-       SMB_VFS_OP_OPENDIR,
        SMB_VFS_OP_FDOPENDIR,
        SMB_VFS_OP_READDIR,
        SMB_VFS_OP_SEEKDIR,
@@ -253,7 +252,6 @@ static struct {
        { SMB_VFS_OP_GET_DFS_REFERRALS, "get_dfs_referrals" },
        { SMB_VFS_OP_CREATE_DFS_PATHAT, "create_dfs_pathat" },
        { SMB_VFS_OP_READ_DFS_PATHAT,   "read_dfs_pathat" },
-       { SMB_VFS_OP_OPENDIR,   "opendir" },
        { SMB_VFS_OP_FDOPENDIR, "fdopendir" },
        { SMB_VFS_OP_READDIR,   "readdir" },
        { SMB_VFS_OP_SEEKDIR,   "seekdir" },
@@ -988,24 +986,6 @@ static NTSTATUS smb_full_audit_snap_delete(struct vfs_handle_struct *handle,
        return status;
 }
 
-static DIR *smb_full_audit_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       DIR *result;
-
-       result = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
-
-       do_log(SMB_VFS_OP_OPENDIR,
-              (result != NULL),
-              handle,
-              "%s",
-              smb_fname_str_do_log(handle->conn, smb_fname));
-
-       return result;
-}
-
 static DIR *smb_full_audit_fdopendir(vfs_handle_struct *handle,
                          files_struct *fsp, const char *mask, uint32_t attr)
 {
@@ -2989,7 +2969,6 @@ static struct vfs_fn_pointers vfs_full_audit_fns = {
        .get_dfs_referrals_fn = smb_full_audit_get_dfs_referrals,
        .create_dfs_pathat_fn = smb_full_audit_create_dfs_pathat,
        .read_dfs_pathat_fn = smb_full_audit_read_dfs_pathat,
-       .opendir_fn = smb_full_audit_opendir,
        .fdopendir_fn = smb_full_audit_fdopendir,
        .readdir_fn = smb_full_audit_readdir,
        .seekdir_fn = smb_full_audit_seekdir,
index d4b68fba37671892f6634eb283f314568410b746..efb6989190f494fa0139344242b944efdd43b252 100644 (file)
@@ -491,26 +491,6 @@ static uint32_t vfs_gluster_fs_capabilities(struct vfs_handle_struct *handle,
        return caps;
 }
 
-static DIR *vfs_gluster_opendir(struct vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *mask,
-                               uint32_t attributes)
-{
-       glfs_fd_t *fd;
-
-       START_PROFILE(syscall_opendir);
-
-       fd = glfs_opendir(handle->data, smb_fname->base_name);
-       if (fd == NULL) {
-               DEBUG(0, ("glfs_opendir(%s) failed: %s\n",
-                         smb_fname->base_name, strerror(errno)));
-       }
-
-       END_PROFILE(syscall_opendir);
-
-       return (DIR *) fd;
-}
-
 static glfs_fd_t *vfs_gluster_fetch_glfd(struct vfs_handle_struct *handle,
                                         files_struct *fsp)
 {
@@ -2046,7 +2026,6 @@ static struct vfs_fn_pointers glusterfs_fns = {
 
        /* Directory Operations */
 
-       .opendir_fn = vfs_gluster_opendir,
        .fdopendir_fn = vfs_gluster_fdopendir,
        .readdir_fn = vfs_gluster_readdir,
        .seekdir_fn = vfs_gluster_seekdir,
index 291a5af763aecbba0a3b8717de0f4ae5824151f2..f35bf0aaca0935902fd9a582c221365c94b4c947 100644 (file)
@@ -755,62 +755,6 @@ err:
        return status;
 }
 
-/* Success: return a mh_dirinfo_struct cast as a DIR
- * Failure: set errno, return NULL
- */
-static DIR *mh_opendir(vfs_handle_struct *handle,
-               const struct smb_filename *smb_fname,
-               const char *mask,
-               uint32_t attr)
-{
-       struct mh_dirinfo_struct *dirInfo;
-
-       DEBUG(MH_INFO_DEBUG, ("Entering with fname '%s'\n",
-               smb_fname->base_name));
-
-       if (alloc_set_client_dirinfo(handle, smb_fname->base_name, &dirInfo))
-       {
-               goto err;
-       }
-
-       if (!dirInfo->isInMediaFiles)
-       {
-               dirInfo->dirstream = SMB_VFS_NEXT_OPENDIR(handle,
-                       smb_fname, mask, attr);
-       } else {
-               struct smb_filename *smb_fname_clientpath =
-                               synthetic_smb_fname(talloc_tos(),
-                                       dirInfo->clientPath,
-                                       NULL,
-                                       NULL,
-                                       smb_fname->flags);
-               if (smb_fname_clientpath == NULL) {
-                       goto err;
-               }
-
-               dirInfo->dirstream = SMB_VFS_NEXT_OPENDIR(handle,
-                       smb_fname_clientpath, mask, attr);
-               TALLOC_FREE(smb_fname_clientpath);
-       }
-
-       if (dirInfo->dirstream == NULL) {
-               goto err;
-       }
-
-       /* Success is freed in closedir. */
-       DEBUG(MH_INFO_DEBUG, ("Leaving with dirInfo->dirpath '%s', "
-                               "dirInfo->clientPath '%s'\n",
-                               dirInfo->dirpath,
-                               dirInfo->clientPath));
-       return (DIR*)dirInfo;
-err:
-       /* Failure is freed here. */
-       DEBUG(MH_ERR_DEBUG, ("Failing with fname '%s'\n",
-               smb_fname->base_name));
-       TALLOC_FREE(dirInfo);
-       return NULL;
-}
-
 static DIR *mh_fdopendir(vfs_handle_struct *handle,
                files_struct *fsp,
                const char *mask,
@@ -2253,7 +2197,6 @@ static struct vfs_fn_pointers vfs_mh_fns = {
 
        /* Directory operations */
 
-       .opendir_fn = mh_opendir,
        .fdopendir_fn = mh_fdopendir,
        .readdir_fn = mh_readdir,
        .seekdir_fn = mh_seekdir,
index 5861e20d88d4558c92221dcfcacb4f2fc0877e51..cb770790479c7cc3d7dc4f16fb9bf4acfa5eb831 100644 (file)
@@ -116,14 +116,6 @@ NTSTATUS vfs_not_implemented_read_dfs_pathat(struct vfs_handle_struct *handle,
        return NT_STATUS_NOT_IMPLEMENTED;
 }
 
-DIR *vfs_not_implemented_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       return NULL;
-}
-
 NTSTATUS vfs_not_implemented_snap_check_path(struct vfs_handle_struct *handle,
                                TALLOC_CTX *mem_ctx,
                                const char *service_path,
@@ -1064,7 +1056,6 @@ static struct vfs_fn_pointers vfs_not_implemented_fns = {
 
        /* Directory operations */
 
-       .opendir_fn = vfs_not_implemented_opendir,
        .fdopendir_fn = vfs_not_implemented_fdopendir,
        .readdir_fn = vfs_not_implemented_readdir,
        .seekdir_fn = vfs_not_implemented_seekdir,
index 4f5ef513cd9f3b877ef66c877768a8ef5ce9347b..0241bd7e5e54cb45f34acfed41ba247edcc6f152 100644 (file)
@@ -73,58 +73,6 @@ static bool shadow_copy_match_name(const char *name)
        return False;
 }
 
-static DIR *shadow_copy_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       shadow_copy_Dir *dirp;
-       DIR *p = SMB_VFS_NEXT_OPENDIR(handle,smb_fname,mask,attr);
-
-       if (!p) {
-               DEBUG(0,("shadow_copy_opendir: SMB_VFS_NEXT_OPENDIR() "
-                       "failed for [%s]\n",
-                       smb_fname->base_name));
-               return NULL;
-       }
-
-       dirp = SMB_MALLOC_P(shadow_copy_Dir);
-       if (!dirp) {
-               DEBUG(0,("shadow_copy_opendir: Out of memory\n"));
-               SMB_VFS_NEXT_CLOSEDIR(handle,p);
-               return NULL;
-       }
-
-       ZERO_STRUCTP(dirp);
-
-       while (True) {
-               struct dirent *d;
-
-               d = SMB_VFS_NEXT_READDIR(handle, p, NULL);
-               if (d == NULL) {
-                       break;
-               }
-
-               if (shadow_copy_match_name(d->d_name)) {
-                       DEBUG(8,("shadow_copy_opendir: hide [%s]\n",d->d_name));
-                       continue;
-               }
-
-               DEBUG(10,("shadow_copy_opendir: not hide [%s]\n",d->d_name));
-
-               dirp->dirs = SMB_REALLOC_ARRAY(dirp->dirs,struct dirent, dirp->num+1);
-               if (!dirp->dirs) {
-                       DEBUG(0,("shadow_copy_opendir: Out of memory\n"));
-                       break;
-               }
-
-               dirp->dirs[dirp->num++] = *d;
-       }
-
-       SMB_VFS_NEXT_CLOSEDIR(handle,p);
-       return((DIR *)dirp);
-}
-
 static DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_struct *fsp, const char *mask, uint32_t attr)
 {
        shadow_copy_Dir *dirp;
@@ -304,7 +252,6 @@ static int shadow_copy_get_shadow_copy_data(vfs_handle_struct *handle,
 }
 
 static struct vfs_fn_pointers vfs_shadow_copy_fns = {
-       .opendir_fn = shadow_copy_opendir,
        .fdopendir_fn = shadow_copy_fdopendir,
        .readdir_fn = shadow_copy_readdir,
        .seekdir_fn = shadow_copy_seekdir,
index 4a049d71cd366d0d6b19b12a33ee15c1093abf4d..3666b2af2b43dc8392c177ec9756367783b45654 100644 (file)
@@ -1087,54 +1087,6 @@ static void convert_sbuf(vfs_handle_struct *handle, const char *fname,
        }
 }
 
-static DIR *shadow_copy2_opendir(vfs_handle_struct *handle,
-                       const struct smb_filename *smb_fname,
-                       const char *mask,
-                       uint32_t attr)
-{
-       time_t timestamp = 0;
-       char *stripped = NULL;
-       DIR *ret;
-       int saved_errno = 0;
-       char *conv;
-       struct smb_filename *conv_smb_fname = NULL;
-
-       if (!shadow_copy2_strip_snapshot(talloc_tos(),
-                               handle,
-                               smb_fname->base_name,
-                               &timestamp,
-                               &stripped)) {
-               return NULL;
-       }
-       if (timestamp == 0) {
-               return SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
-       }
-       conv = shadow_copy2_convert(talloc_tos(), handle, stripped, timestamp);
-       TALLOC_FREE(stripped);
-       if (conv == NULL) {
-               return NULL;
-       }
-       conv_smb_fname = synthetic_smb_fname(talloc_tos(),
-                                       conv,
-                                       NULL,
-                                       NULL,
-                                       smb_fname->flags);
-       if (conv_smb_fname == NULL) {
-               TALLOC_FREE(conv);
-               return NULL;
-       }
-       ret = SMB_VFS_NEXT_OPENDIR(handle, conv_smb_fname, mask, attr);
-       if (ret == NULL) {
-               saved_errno = errno;
-       }
-       TALLOC_FREE(conv);
-       TALLOC_FREE(conv_smb_fname);
-       if (saved_errno != 0) {
-               errno = saved_errno;
-       }
-       return ret;
-}
-
 static int shadow_copy2_renameat(vfs_handle_struct *handle,
                                files_struct *srcfsp,
                                const struct smb_filename *smb_fname_src,
@@ -3233,7 +3185,6 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle,
 
 static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
        .connect_fn = shadow_copy2_connect,
-       .opendir_fn = shadow_copy2_opendir,
        .disk_free_fn = shadow_copy2_disk_free,
        .get_quota_fn = shadow_copy2_get_quota,
        .create_dfs_pathat_fn = shadow_copy2_create_dfs_pathat,
index 91729f2abd646550f2e45b88439e7d9ec47145b9..86bcfd85686e916f42cee04aa0f20b684980b186 100644 (file)
@@ -1963,52 +1963,6 @@ err_out:
        return NULL;
 }
 
-static DIR *snapper_gmt_opendir(vfs_handle_struct *handle,
-                               const struct smb_filename *smb_fname,
-                               const char *mask,
-                               uint32_t attr)
-{
-       time_t timestamp;
-       char *stripped;
-       DIR *ret;
-       int saved_errno;
-       char *conv;
-       struct smb_filename *conv_smb_fname = NULL;
-
-       if (!snapper_gmt_strip_snapshot(talloc_tos(),
-                       handle,
-                       smb_fname->base_name,
-                       &timestamp,
-                       &stripped)) {
-               return NULL;
-       }
-       if (timestamp == 0) {
-               return SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
-       }
-       conv = snapper_gmt_convert(talloc_tos(), handle, stripped, timestamp);
-       TALLOC_FREE(stripped);
-       if (conv == NULL) {
-               return NULL;
-       }
-       conv_smb_fname = synthetic_smb_fname(talloc_tos(),
-                                       conv,
-                                       NULL,
-                                       NULL,
-                                       smb_fname->flags);
-       if (conv_smb_fname == NULL) {
-               TALLOC_FREE(conv);
-               errno = ENOMEM;
-               return NULL;
-       }
-
-       ret = SMB_VFS_NEXT_OPENDIR(handle, conv_smb_fname, mask, attr);
-       saved_errno = errno;
-       TALLOC_FREE(conv);
-       TALLOC_FREE(conv_smb_fname);
-       errno = saved_errno;
-       return ret;
-}
-
 static int snapper_gmt_renameat(vfs_handle_struct *handle,
                        files_struct *srcfsp,
                        const struct smb_filename *smb_fname_src,
@@ -2880,7 +2834,6 @@ static struct vfs_fn_pointers snapper_fns = {
        .snap_delete_fn = snapper_snap_delete,
        .get_shadow_copy_data_fn = snapper_get_shadow_copy_data,
        .create_dfs_pathat_fn = snapper_create_dfs_pathat,
-       .opendir_fn = snapper_gmt_opendir,
        .disk_free_fn = snapper_gmt_disk_free,
        .get_quota_fn = snapper_gmt_get_quota,
        .renameat_fn = snapper_gmt_renameat,
index 5548f771fa5f472e42e04ce988b203315af602da..626ccd63921f314cad9c2b8007e338764d1f8d27 100644 (file)
@@ -446,26 +446,6 @@ static NTSTATUS smb_time_audit_snap_delete(struct vfs_handle_struct *handle,
        return status;
 }
 
-static DIR *smb_time_audit_opendir(vfs_handle_struct *handle,
-                                  const struct smb_filename *smb_fname,
-                                  const char *mask, uint32_t attr)
-{
-       DIR *result;
-       struct timespec ts1,ts2;
-       double timediff;
-
-       clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_OPENDIR(handle, smb_fname, mask, attr);
-       clock_gettime_mono(&ts2);
-       timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
-
-       if (timediff > audit_timeout) {
-               smb_time_audit_log_smb_fname("opendir", timediff, smb_fname);
-       }
-
-       return result;
-}
-
 static DIR *smb_time_audit_fdopendir(vfs_handle_struct *handle,
                                              files_struct *fsp,
                                              const char *mask, uint32_t attr)
@@ -2863,7 +2843,6 @@ static struct vfs_fn_pointers vfs_time_audit_fns = {
        .get_dfs_referrals_fn = smb_time_audit_get_dfs_referrals,
        .create_dfs_pathat_fn = smb_time_audit_create_dfs_pathat,
        .read_dfs_pathat_fn = smb_time_audit_read_dfs_pathat,
-       .opendir_fn = smb_time_audit_opendir,
        .fdopendir_fn = smb_time_audit_fdopendir,
        .readdir_fn = smb_time_audit_readdir,
        .seekdir_fn = smb_time_audit_seekdir,
index c0e0753210d068cb6495d78dfcbc6595f02ff19e..6fea0aa05814d4b116147243229f00744a8bda50 100644 (file)
@@ -556,58 +556,6 @@ err:
        return status;
 }
 
-/* Success: return a um_dirinfo_struct cast as a DIR
- * Failure: set errno, return NULL
- */
-static DIR *um_opendir(vfs_handle_struct *handle,
-                      const struct smb_filename *smb_fname,
-                      const char *mask,
-                      uint32_t attr)
-{
-       struct um_dirinfo_struct *dirInfo;
-
-       DEBUG(10, ("Entering with fname '%s'\n", smb_fname->base_name));
-
-       if (alloc_set_client_dirinfo(handle, smb_fname->base_name, &dirInfo)) {
-               goto err;
-       }
-
-       if (!dirInfo->isInMediaFiles) {
-               dirInfo->dirstream = SMB_VFS_NEXT_OPENDIR(
-                       handle, smb_fname, mask, attr);
-       } else {
-               struct smb_filename *client_smb_fname =
-                       synthetic_smb_fname(talloc_tos(),
-                                       dirInfo->clientPath,
-                                       NULL,
-                                       NULL,
-                                       smb_fname->flags);
-               if (client_smb_fname == NULL) {
-                       goto err;
-               }
-
-               dirInfo->dirstream = SMB_VFS_NEXT_OPENDIR(
-                       handle, client_smb_fname, mask, attr);
-
-               TALLOC_FREE(client_smb_fname);
-       }
-
-       if (dirInfo->dirstream == NULL) {
-               goto err;
-       }
-
-       DEBUG(10, ("Leaving with dirInfo->dirpath '%s', "
-                             "dirInfo->clientPath '%s'\n",
-                             dirInfo->dirpath,
-                             dirInfo->clientPath));
-       return (DIR*)dirInfo;
-
-err:
-       DEBUG(1, ("Failing with fname '%s'\n", smb_fname->base_name));
-       TALLOC_FREE(dirInfo);
-       return NULL;
-}
-
 static DIR *um_fdopendir(vfs_handle_struct *handle,
                         files_struct *fsp,
                         const char *mask,
@@ -1868,7 +1816,6 @@ static struct vfs_fn_pointers vfs_um_fns = {
 
        /* Directory operations */
 
-       .opendir_fn = um_opendir,
        .fdopendir_fn = um_fdopendir,
        .readdir_fn = um_readdir,
        .seekdir_fn = um_seekdir,
index 7dc15158ccb614b1a206c0061bf78ff35c41dab9..9e0d14cd57a3cfd902446032d5dd56e59eae6cd3 100644 (file)
@@ -1593,15 +1593,6 @@ NTSTATUS smb_vfs_call_read_dfs_pathat(struct vfs_handle_struct *handle,
                                                preferral_count);
 }
 
-DIR *smb_vfs_call_opendir(struct vfs_handle_struct *handle,
-                                       const struct smb_filename *smb_fname,
-                                       const char *mask,
-                                       uint32_t attributes)
-{
-       VFS_FIND(opendir);
-       return handle->fns->opendir_fn(handle, smb_fname, mask, attributes);
-}
-
 DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
                                        struct files_struct *fsp,
                                        const char *mask,