diff options
author | Ralph Boehme <slow@samba.org> | 2020-03-23 10:44:08 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2020-03-24 21:23:43 +0000 |
commit | 2a5d994b1a136af1ed1542fbb008c3744ac661bb (patch) | |
tree | ea089e956ceac5365c57f2252b74b2cbdc513f16 | |
parent | 54e0f25071364fafb98f2383828856184a6c0e8d (diff) | |
download | samba-2a5d994b1a136af1ed1542fbb008c3744ac661bb.tar.gz |
vfs: remove SMB_VFS_OPENDIR()
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
-rw-r--r-- | examples/VFS/skel_opaque.c | 9 | ||||
-rw-r--r-- | examples/VFS/skel_transparent.c | 9 | ||||
-rw-r--r-- | source3/include/vfs.h | 13 | ||||
-rw-r--r-- | source3/include/vfs_macros.h | 5 | ||||
-rw-r--r-- | source3/modules/vfs_audit.c | 18 | ||||
-rw-r--r-- | source3/modules/vfs_cap.c | 26 | ||||
-rw-r--r-- | source3/modules/vfs_catia.c | 39 | ||||
-rw-r--r-- | source3/modules/vfs_ceph.c | 20 | ||||
-rw-r--r-- | source3/modules/vfs_ceph_snapshots.c | 48 | ||||
-rw-r--r-- | source3/modules/vfs_default.c | 14 | ||||
-rw-r--r-- | source3/modules/vfs_dirsort.c | 62 | ||||
-rw-r--r-- | source3/modules/vfs_extd_audit.c | 24 | ||||
-rw-r--r-- | source3/modules/vfs_full_audit.c | 21 | ||||
-rw-r--r-- | source3/modules/vfs_glusterfs.c | 21 | ||||
-rw-r--r-- | source3/modules/vfs_media_harmony.c | 57 | ||||
-rw-r--r-- | source3/modules/vfs_not_implemented.c | 9 | ||||
-rw-r--r-- | source3/modules/vfs_shadow_copy.c | 53 | ||||
-rw-r--r-- | source3/modules/vfs_shadow_copy2.c | 49 | ||||
-rw-r--r-- | source3/modules/vfs_snapper.c | 47 | ||||
-rw-r--r-- | source3/modules/vfs_time_audit.c | 21 | ||||
-rw-r--r-- | source3/modules/vfs_unityed_media.c | 53 | ||||
-rw-r--r-- | source3/smbd/vfs.c | 9 |
22 files changed, 1 insertions, 626 deletions
diff --git a/examples/VFS/skel_opaque.c b/examples/VFS/skel_opaque.c index c1b5923b752..ed9f108009e 100644 --- a/examples/VFS/skel_opaque.c +++ b/examples/VFS/skel_opaque.c @@ -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, diff --git a/examples/VFS/skel_transparent.c b/examples/VFS/skel_transparent.c index d2d05673fb4..1dce543734f 100644 --- a/examples/VFS/skel_transparent.c +++ b/examples/VFS/skel_transparent.c @@ -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, diff --git a/source3/include/vfs.h b/source3/include/vfs.h index 85da21513fc..bda6cde3fdc 100644 --- a/source3/include/vfs.h +++ b/source3/include/vfs.h @@ -292,6 +292,7 @@ /* 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, diff --git a/source3/include/vfs_macros.h b/source3/include/vfs_macros.h index 112169ab83b..c8c41cd62f5 100644 --- a/source3/include/vfs_macros.h +++ b/source3/include/vfs_macros.h @@ -106,11 +106,6 @@ (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) \ diff --git a/source3/modules/vfs_audit.c b/source3/modules/vfs_audit.c index 84640b2bfa9..916d8a04206 100644 --- a/source3/modules/vfs_audit.c +++ b/source3/modules/vfs_audit.c @@ -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, diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c index e67cb750e0f..d9c741dd1f8 100644 --- a/source3/modules/vfs_cap.c +++ b/source3/modules/vfs_cap.c @@ -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, diff --git a/source3/modules/vfs_catia.c b/source3/modules/vfs_catia.c index 5bb55cf89f6..e90adaa2d46 100644 --- a/source3/modules/vfs_catia.c +++ b/source3/modules/vfs_catia.c @@ -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 */ diff --git a/source3/modules/vfs_ceph.c b/source3/modules/vfs_ceph.c index 76393a84152..7f4d65d4871 100644 --- a/source3/modules/vfs_ceph.c +++ b/source3/modules/vfs_ceph.c @@ -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, diff --git a/source3/modules/vfs_ceph_snapshots.c b/source3/modules/vfs_ceph_snapshots.c index 7ff1c60a402..7af9ff655c1 100644 --- a/source3/modules/vfs_ceph_snapshots.c +++ b/source3/modules/vfs_ceph_snapshots.c @@ -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, - ×tamp, - 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, diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index a30f3ba1d31..ca1f000143a 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -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, diff --git a/source3/modules/vfs_dirsort.c b/source3/modules/vfs_dirsort.c index c6b5ea41c93..f43a5f0b98a 100644 --- a/source3/modules/vfs_dirsort.c +++ b/source3/modules/vfs_dirsort.c @@ -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, diff --git a/source3/modules/vfs_extd_audit.c b/source3/modules/vfs_extd_audit.c index 97b072f00de..b8cb5d54e6c 100644 --- a/source3/modules/vfs_extd_audit.c +++ b/source3/modules/vfs_extd_audit.c @@ -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, diff --git a/source3/modules/vfs_full_audit.c b/source3/modules/vfs_full_audit.c index 5c8267dea9f..1ea58a0ffab 100644 --- a/source3/modules/vfs_full_audit.c +++ b/source3/modules/vfs_full_audit.c @@ -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, diff --git a/source3/modules/vfs_glusterfs.c b/source3/modules/vfs_glusterfs.c index d4b68fba376..efb6989190f 100644 --- a/source3/modules/vfs_glusterfs.c +++ b/source3/modules/vfs_glusterfs.c @@ -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, diff --git a/source3/modules/vfs_media_harmony.c b/source3/modules/vfs_media_harmony.c index 291a5af763a..f35bf0aaca0 100644 --- a/source3/modules/vfs_media_harmony.c +++ b/source3/modules/vfs_media_harmony.c @@ -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, diff --git a/source3/modules/vfs_not_implemented.c b/source3/modules/vfs_not_implemented.c index 5861e20d88d..cb770790479 100644 --- a/source3/modules/vfs_not_implemented.c +++ b/source3/modules/vfs_not_implemented.c @@ -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, diff --git a/source3/modules/vfs_shadow_copy.c b/source3/modules/vfs_shadow_copy.c index 4f5ef513cd9..0241bd7e5e5 100644 --- a/source3/modules/vfs_shadow_copy.c +++ b/source3/modules/vfs_shadow_copy.c @@ -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, diff --git a/source3/modules/vfs_shadow_copy2.c b/source3/modules/vfs_shadow_copy2.c index 4a049d71cd3..3666b2af2b4 100644 --- a/source3/modules/vfs_shadow_copy2.c +++ b/source3/modules/vfs_shadow_copy2.c @@ -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, - ×tamp, - &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, diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c index 91729f2abd6..86bcfd85686 100644 --- a/source3/modules/vfs_snapper.c +++ b/source3/modules/vfs_snapper.c @@ -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, - ×tamp, - &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, diff --git a/source3/modules/vfs_time_audit.c b/source3/modules/vfs_time_audit.c index 5548f771fa5..626ccd63921 100644 --- a/source3/modules/vfs_time_audit.c +++ b/source3/modules/vfs_time_audit.c @@ -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, diff --git a/source3/modules/vfs_unityed_media.c b/source3/modules/vfs_unityed_media.c index c0e0753210d..6fea0aa0581 100644 --- a/source3/modules/vfs_unityed_media.c +++ b/source3/modules/vfs_unityed_media.c @@ -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, diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 7dc15158ccb..9e0d14cd57a 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -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, |