vfs: Remove "sbuf" from readdir_fn()
authorVolker Lendecke <vl@samba.org>
Tue, 20 Jun 2023 10:42:52 +0000 (12:42 +0200)
committerJeremy Allison <jra@samba.org>
Fri, 23 Jun 2023 18:29:40 +0000 (18:29 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jun 23 18:29:40 UTC 2023 on atb-devel-224

18 files changed:
examples/VFS/skel_opaque.c
examples/VFS/skel_transparent.c
source3/include/vfs.h
source3/include/vfs_macros.h
source3/modules/vfs_cap.c
source3/modules/vfs_ceph.c
source3/modules/vfs_default.c
source3/modules/vfs_dirsort.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_time_audit.c
source3/modules/vfs_unityed_media.c
source3/modules/vfs_widelinks.c
source3/smbd/vfs.c

index cbaf9a272a86cfdc71d050b403b180048183498b..255fa830402e5e854ec8771bfc74609a36eab1d2 100644 (file)
@@ -157,8 +157,7 @@ static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
 
 static struct dirent *skel_readdir(vfs_handle_struct *handle,
                                   struct files_struct *dirfsp,
-                                  DIR *dirp,
-                                  SMB_STRUCT_STAT *sbuf)
+                                  DIR *dirp)
 {
        return NULL;
 }
index 9c08b87f7c7911ae7c98619275d6e5fa9a47d5ac..461228f09afd617cfce94da8ae2d687da0b58bfd 100644 (file)
@@ -163,12 +163,10 @@ static DIR *skel_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
        return SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr);
 }
 
-static struct dirent *skel_readdir(vfs_handle_struct *handle,
-                                  struct files_struct *dirfsp,
-                                  DIR *dirp,
-                                  SMB_STRUCT_STAT *sbuf)
+static struct dirent *
+skel_readdir(vfs_handle_struct *handle, struct files_struct *dirfsp, DIR *dirp)
 {
-       return SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf);
+       return SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp);
 }
 
 static void skel_rewind_dir(vfs_handle_struct *handle, DIR *dirp)
index eafc432be4360440f7e378ea885eaefabc987098..dfae16fbc24a4ce8c193eb27ca6ef8c8494a81e6 100644 (file)
  * Version 48 - Add dirfsp to connectpath_fn()
  * Change to Version 49 - will ship with 4.19
  * Version 49 - remove seekdir and telldir
+ * Version 49 - remove "sbuf" argument from readdir_fn()
  */
 
 #define SMB_VFS_INTERFACE_VERSION 49
@@ -967,8 +968,7 @@ struct vfs_fn_pointers {
        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,
                                     struct files_struct *dirfsp,
-                                    DIR *dirp,
-                                    SMB_STRUCT_STAT *sbuf);
+                                    DIR *dirp);
        void (*rewind_dir_fn)(struct vfs_handle_struct *handle, DIR *dirp);
        int (*mkdirat_fn)(struct vfs_handle_struct *handle,
                        struct files_struct *dirfsp,
@@ -1462,8 +1462,7 @@ DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
                                        uint32_t attributes);
 struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
                                    struct files_struct *dirfsp,
-                                   DIR *dirp,
-                                   SMB_STRUCT_STAT *sbuf);
+                                   DIR *dirp);
 void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle,
                             DIR *dirp);
 int smb_vfs_call_mkdirat(struct vfs_handle_struct *handle,
@@ -1904,8 +1903,7 @@ DIR *vfs_not_implemented_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
                                   const char *mask, uint32_t attr);
 struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle,
                                           struct files_struct *dirfsp,
-                                          DIR *dirp,
-                                          SMB_STRUCT_STAT *sbuf);
+                                          DIR *dirp);
 void vfs_not_implemented_rewind_dir(vfs_handle_struct *handle, DIR *dirp);
 int vfs_not_implemented_mkdirat(vfs_handle_struct *handle,
                struct files_struct *dirfsp,
index 29ce22e98c58bc45317479f286086c38ad50bf24..9196f6e5e405f26cd8fbed8af77cf841b70fbb38 100644 (file)
 #define SMB_VFS_NEXT_FDOPENDIR(handle, fsp, mask, attr) \
        smb_vfs_call_fdopendir((handle)->next, (fsp), (mask), (attr))
 
-#define SMB_VFS_READDIR(conn, dirfsp, dirp, sbuf) \
-       smb_vfs_call_readdir((conn)->vfs_handles, (dirfsp), (dirp), (sbuf))
-#define SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf) \
-       smb_vfs_call_readdir((handle)->next, (dirfsp), (dirp), (sbuf))
+#define SMB_VFS_READDIR(conn, dirfsp, dirp) \
+       smb_vfs_call_readdir((conn)->vfs_handles, (dirfsp), (dirp))
+#define SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp) \
+       smb_vfs_call_readdir((handle)->next, (dirfsp), (dirp))
 
 #define SMB_VFS_REWINDDIR(conn, dirp) \
        smb_vfs_call_rewind_dir((conn)->vfs_handles, (dirp))
index ac2c1b0410d85dffdeabe8c3fbf5a929a492b98b..3553e118cc2cfcd6fce559e8bbe45ba71ff56885 100644 (file)
@@ -84,10 +84,8 @@ static int cap_get_quota(vfs_handle_struct *handle,
        return SMB_VFS_NEXT_GET_QUOTA(handle, cap_smb_fname, qtype, id, dq);
 }
 
-static struct dirent *cap_readdir(vfs_handle_struct *handle,
-                                 struct files_struct *dirfsp,
-                                 DIR *dirp,
-                                 SMB_STRUCT_STAT *sbuf)
+static struct dirent *
+cap_readdir(vfs_handle_struct *handle, struct files_struct *dirfsp, DIR *dirp)
 {
        struct dirent *result;
        struct dirent *newdirent;
@@ -95,7 +93,7 @@ static struct dirent *cap_readdir(vfs_handle_struct *handle,
        size_t newnamelen;
        DEBUG(3,("cap: cap_readdir\n"));
 
-       result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, NULL);
+       result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp);
        if (!result) {
                return NULL;
        }
index af303ac60b7f95a64b4950957cea644039ac43c2..d7772c62119b00b4ad770b8c667cbf1496904008 100644 (file)
@@ -451,8 +451,7 @@ static DIR *cephwrap_fdopendir(struct vfs_handle_struct *handle,
 
 static struct dirent *cephwrap_readdir(struct vfs_handle_struct *handle,
                                       struct files_struct *dirfsp,
-                                      DIR *dirp,
-                                      SMB_STRUCT_STAT *sbuf)
+                                      DIR *dirp)
 {
        struct dirent *result;
 
@@ -460,10 +459,6 @@ static struct dirent *cephwrap_readdir(struct vfs_handle_struct *handle,
        result = ceph_readdir(handle->data, (struct ceph_dir_result *) dirp);
        DBG_DEBUG("[CEPH] readdir(...) = %p\n", result);
 
-       /* Default Posix readdir() does not give us stat info.
-        * Set to invalid to indicate we didn't return this info. */
-       if (sbuf)
-               SET_STAT_INVALID(*sbuf);
        return result;
 }
 
index 1ea0dded61936838c04eb97012c74739609933ce..1d4b9b1a8402f056d26153f50d5aecd59b2df401 100644 (file)
@@ -594,58 +594,17 @@ static DIR *vfswrap_fdopendir(vfs_handle_struct *handle,
        return result;
 }
 
-
 static struct dirent *vfswrap_readdir(vfs_handle_struct *handle,
                                      struct files_struct *dirfsp,
-                                     DIR *dirp,
-                                     SMB_STRUCT_STAT *sbuf)
+                                     DIR *dirp)
 {
        struct dirent *result;
-       bool fake_ctime = lp_fake_directory_create_times(SNUM(handle->conn));
-       int flags = AT_SYMLINK_NOFOLLOW;
-       SMB_STRUCT_STAT st = {0};
-       int ret;
 
        START_PROFILE(syscall_readdir);
 
        result = readdir(dirp);
        END_PROFILE(syscall_readdir);
 
-       if (sbuf == NULL) {
-               return result;
-       }
-       if (result == NULL) {
-               return NULL;
-       }
-
-       /*
-        * Default Posix readdir() does not give us stat info.
-        * Set to invalid to indicate we didn't return this info.
-        */
-       SET_STAT_INVALID(*sbuf);
-
-       ret = sys_fstatat(dirfd(dirp),
-                     result->d_name,
-                     &st,
-                     flags,
-                     fake_ctime);
-       if (ret != 0) {
-               return result;
-       }
-
-       /*
-        * As this is an optimization, ignore it if we stat'ed a
-        * symlink for non-POSIX context. Make the caller do it again
-        * as we don't know if they wanted the link info, or its
-        * target info.
-        */
-       if (S_ISLNK(st.st_ex_mode) &&
-           !(dirfsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH))
-       {
-               return result;
-       }
-       *sbuf = st;
-
        return result;
 }
 
index 89637aa38f29b7925755bc56821f6481306fc7f6..c4baf819b0384cee94d5099dad7e730a1a002bf1 100644 (file)
@@ -79,10 +79,7 @@ static bool open_and_sort_dir(vfs_handle_struct *handle,
                return false;
        }
 
-       dp = SMB_VFS_NEXT_READDIR(handle,
-                                 data->fsp,
-                                 data->source_directory,
-                                 NULL);
+       dp = SMB_VFS_NEXT_READDIR(handle, data->fsp, data->source_directory);
        if (dp == NULL) {
                return false;
        }
@@ -125,8 +122,7 @@ static bool open_and_sort_dir(vfs_handle_struct *handle,
                total_count++;
                dp = SMB_VFS_NEXT_READDIR(handle,
                                          data->fsp,
-                                         data->source_directory,
-                                         NULL);
+                                         data->source_directory);
        } while (dp != NULL);
 
        data->number_of_entries = total_count;
@@ -185,8 +181,7 @@ static DIR *dirsort_fdopendir(vfs_handle_struct *handle,
 
 static struct dirent *dirsort_readdir(vfs_handle_struct *handle,
                                      struct files_struct *dirfsp,
-                                     DIR *dirp,
-                                     SMB_STRUCT_STAT *sbuf)
+                                     DIR *dirp)
 {
        struct dirsort_privates *data = NULL;
        struct timespec current_mtime;
index b407de0d778ca5dc7acbe405db568b90a89d6159..9fd8a7515720eec4a3ad229d180991190ec93f42 100644 (file)
@@ -1015,12 +1015,11 @@ static DIR *smb_full_audit_fdopendir(vfs_handle_struct *handle,
 
 static struct dirent *smb_full_audit_readdir(vfs_handle_struct *handle,
                                             struct files_struct *dirfsp,
-                                            DIR *dirp,
-                                            SMB_STRUCT_STAT *sbuf)
+                                            DIR *dirp)
 {
        struct dirent *result;
 
-       result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf);
+       result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp);
 
        /* This operation has no reasonable error condition
         * (End of dir is also failure), so always succeed.
index 0c2d6950421c0ce48eb2e16c70c78d03d28c6673..a1c4dfcd64fe650cdd2b4c604dae40aed133b094 100644 (file)
@@ -649,34 +649,21 @@ static int vfs_gluster_closedir(struct vfs_handle_struct *handle, DIR *dirp)
 
 static struct dirent *vfs_gluster_readdir(struct vfs_handle_struct *handle,
                                          struct files_struct *dirfsp,
-                                         DIR *dirp,
-                                         SMB_STRUCT_STAT *sbuf)
+                                         DIR *dirp)
 {
        static char direntbuf[512];
        int ret;
-       struct stat stat;
        struct dirent *dirent = 0;
 
        START_PROFILE(syscall_readdir);
-       if (sbuf != NULL) {
-               ret = glfs_readdirplus_r((void *)dirp, &stat, (void *)direntbuf,
-                                        &dirent);
-       } else {
-               ret = glfs_readdir_r((void *)dirp, (void *)direntbuf, &dirent);
-       }
+
+       ret = glfs_readdir_r((void *)dirp, (void *)direntbuf, &dirent);
 
        if ((ret < 0) || (dirent == NULL)) {
                END_PROFILE(syscall_readdir);
                return NULL;
        }
 
-       if (sbuf != NULL) {
-               SET_STAT_INVALID(*sbuf);
-               if (!S_ISLNK(stat.st_mode)) {
-                       smb_stat_ex_from_stat(sbuf, &stat);
-               }
-       }
-
        END_PROFILE(syscall_readdir);
        return dirent;
 }
index ceace9c5b2d3e2f21ce1cfbfb7d5543698143b4c..a027254c6b384d986af5e638d3f37062987108fa 100644 (file)
@@ -817,10 +817,8 @@ err:
  * End of data: return NULL
  * Failure: set errno, return NULL
  */
-static struct dirent *mh_readdir(vfs_handle_struct *handle,
-                                struct files_struct *dirfsp,
-                                DIR *dirp,
-                                SMB_STRUCT_STAT *sbuf)
+static struct dirent *
+mh_readdir(vfs_handle_struct *handle, struct files_struct *dirfsp, DIR *dirp)
 {
        mh_dirinfo_struct* dirInfo = (mh_dirinfo_struct*)dirp;
        struct dirent *d = NULL;
@@ -843,7 +841,7 @@ static struct dirent *mh_readdir(vfs_handle_struct *handle,
 
        if (! dirInfo->isInMediaFiles)
        {
-               d = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream, sbuf);
+               d = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream);
                goto out;
        }
 
@@ -853,7 +851,7 @@ static struct dirent *mh_readdir(vfs_handle_struct *handle,
                bool isAppleDouble;
 
                skip = False;
-               d = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream, sbuf);
+               d = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream);
 
                if (d == NULL)
                {
index aeec1a4a3763dd2028f22fb8f042a4b744418259..b00a4993bc5ff5d906d2833b576bac2f973a7b36 100644 (file)
@@ -168,8 +168,7 @@ DIR *vfs_not_implemented_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
 _PUBLIC_
 struct dirent *vfs_not_implemented_readdir(vfs_handle_struct *handle,
                                           struct files_struct *dirfsp,
-                                          DIR *dirp,
-                                          SMB_STRUCT_STAT *sbuf)
+                                          DIR *dirp)
 {
        errno = ENOSYS;
        return NULL;
index e32826f88b41cce08b8efc1dac6eb5f079db08b3..e87cefbb6945ccd9240608273d1a35651405f3b2 100644 (file)
@@ -98,7 +98,7 @@ static DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
        while (True) {
                struct dirent *d;
 
-               d = SMB_VFS_NEXT_READDIR(handle, fsp, p, NULL);
+               d = SMB_VFS_NEXT_READDIR(handle, fsp, p);
                if (d == NULL) {
                        break;
                }
@@ -127,8 +127,7 @@ static DIR *shadow_copy_fdopendir(vfs_handle_struct *handle, files_struct *fsp,
 
 static struct dirent *shadow_copy_readdir(vfs_handle_struct *handle,
                                          struct files_struct *dirfsp,
-                                         DIR *_dirp,
-                                         SMB_STRUCT_STAT *sbuf)
+                                         DIR *_dirp)
 {
        shadow_copy_Dir *dirp = (shadow_copy_Dir *)_dirp;
 
index 2bbd3a5d35fbd5d40ed01d4bf10cf8d3063ae5a7..9a69259edd8afaded3e1abf8f2b88279f3a7e164 100644 (file)
@@ -2276,7 +2276,7 @@ static int shadow_copy2_get_shadow_copy_data(
                time(&(priv->snaps->fetch_time));
        }
 
-       while ((d = SMB_VFS_NEXT_READDIR(handle, dirfsp, p, NULL))) {
+       while ((d = SMB_VFS_NEXT_READDIR(handle, dirfsp, p))) {
                char snapshot[GMT_NAME_LEN+1];
                SHADOW_COPY_LABEL *tlabels;
 
@@ -3373,96 +3373,6 @@ static int shadow_copy2_connect(struct vfs_handle_struct *handle,
        return 0;
 }
 
-static struct dirent *shadow_copy2_readdir(vfs_handle_struct *handle,
-                                          struct files_struct *dirfsp,
-                                          DIR *dirp,
-                                          SMB_STRUCT_STAT *sbuf)
-{
-       struct shadow_copy2_private *priv = NULL;
-       struct dirent *ent = NULL;
-       struct smb_filename atname;
-       struct smb_filename *full_fname = NULL;
-       time_t timestamp = 0;
-       char *stripped = NULL;
-       char *conv = NULL;
-       char *abspath = NULL;
-       bool converted = false;
-
-       SMB_VFS_HANDLE_GET_DATA(handle, priv, struct shadow_copy2_private,
-                               return NULL);
-
-       ent = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf);
-       if (ent == NULL) {
-               return NULL;
-       }
-       if (sbuf == NULL) {
-               return ent;
-       }
-       if (ISDOT(dirfsp->fsp_name->base_name) && ISDOTDOT(ent->d_name)) {
-               return ent;
-       }
-
-       atname = (struct smb_filename) {
-               .base_name = ent->d_name,
-               .twrp = dirfsp->fsp_name->twrp,
-               .flags = dirfsp->fsp_name->flags,
-       };
-
-       full_fname = full_path_from_dirfsp_atname(talloc_tos(),
-                                                 dirfsp,
-                                                 &atname);
-       if (full_fname == NULL) {
-               return NULL;
-       }
-
-       if (!shadow_copy2_strip_snapshot_converted(talloc_tos(),
-                                                  handle,
-                                                  full_fname,
-                                                  &timestamp,
-                                                  &stripped,
-                                                  &converted)) {
-               TALLOC_FREE(full_fname);
-               return NULL;
-       }
-
-       if (timestamp == 0 && !converted) {
-               /* Not a snapshot path, no need for convert_sbuf() */
-               TALLOC_FREE(stripped);
-               TALLOC_FREE(full_fname);
-               return ent;
-       }
-
-       if (timestamp == 0) {
-               abspath = make_path_absolute(talloc_tos(),
-                                            priv,
-                                            full_fname->base_name);
-               TALLOC_FREE(full_fname);
-               if (abspath == NULL) {
-                       return NULL;
-               }
-       } else {
-               conv = shadow_copy2_convert(talloc_tos(),
-                                           handle,
-                                           stripped,
-                                           timestamp);
-               TALLOC_FREE(stripped);
-               if (conv == NULL) {
-                       return NULL;
-               }
-
-               abspath = make_path_absolute(talloc_tos(), priv, conv);
-               TALLOC_FREE(conv);
-               if (abspath == NULL) {
-                       return NULL;
-               }
-       }
-
-       convert_sbuf(handle, abspath, sbuf);
-
-       TALLOC_FREE(abspath);
-       return ent;
-}
-
 static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
        .connect_fn = shadow_copy2_connect,
        .disk_free_fn = shadow_copy2_disk_free,
@@ -3494,7 +3404,6 @@ static struct vfs_fn_pointers vfs_shadow_copy2_fns = {
        .pwrite_recv_fn = shadow_copy2_pwrite_recv,
        .connectpath_fn = shadow_copy2_connectpath,
        .parent_pathname_fn = shadow_copy2_parent_pathname,
-       .readdir_fn = shadow_copy2_readdir,
 };
 
 static_decl_vfs;
index 0807f0243181e9d22e61314f9b89de7c842d4970..59bc68861b46645cc173d06a10970670c6193456 100644 (file)
@@ -489,15 +489,14 @@ static DIR *smb_time_audit_fdopendir(vfs_handle_struct *handle,
 
 static struct dirent *smb_time_audit_readdir(vfs_handle_struct *handle,
                                             struct files_struct *dirfsp,
-                                            DIR *dirp,
-                                            SMB_STRUCT_STAT *sbuf)
+                                            DIR *dirp)
 {
        struct dirent *result;
        struct timespec ts1,ts2;
        double timediff;
 
        clock_gettime_mono(&ts1);
-       result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp, sbuf);
+       result = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirp);
        clock_gettime_mono(&ts2);
        timediff = nsec_time_diff(&ts2,&ts1)*1.0e-9;
 
index 483afd5d5cee4d326247c341e625be1a7ef76918..30608c31018e502c27260bcada83a9f0498d63d4 100644 (file)
@@ -614,10 +614,8 @@ err:
  * End of data: return NULL
  * Failure: set errno, return NULL
  */
-static struct dirent *um_readdir(vfs_handle_struct *handle,
-                                struct files_struct *dirfsp,
-                                DIR *dirp,
-                                SMB_STRUCT_STAT *sbuf)
+static struct dirent *
+um_readdir(vfs_handle_struct *handle, struct files_struct *dirfsp, DIR *dirp)
 {
        um_dirinfo_struct* dirInfo = (um_dirinfo_struct*)dirp;
        struct dirent *d = NULL;
@@ -633,7 +631,7 @@ static struct dirent *um_readdir(vfs_handle_struct *handle,
                   dirInfo->clientSubDirname));
 
        if (!dirInfo->isInMediaFiles) {
-               return SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream, sbuf);
+               return SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream);
        }
 
        do {
@@ -644,7 +642,7 @@ static struct dirent *um_readdir(vfs_handle_struct *handle,
                uintmax_t number;
 
                skip = false;
-               d = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream, sbuf);
+               d = SMB_VFS_NEXT_READDIR(handle, dirfsp, dirInfo->dirstream);
 
                if (d == NULL) {
                        break;
index 2a35ea5eb689a3c544d139e18f171de2b9d5fc3f..23c9aebe158906f9408bc11230786e668dc92083 100644 (file)
@@ -370,41 +370,6 @@ static int widelinks_openat(vfs_handle_struct *handle,
                                   &how);
 }
 
-static struct dirent *widelinks_readdir(vfs_handle_struct *handle,
-                                       struct files_struct *dirfsp,
-                                       DIR *dirp,
-                                       SMB_STRUCT_STAT *sbuf)
-{
-       struct widelinks_config *config = NULL;
-       struct dirent *result;
-
-       SMB_VFS_HANDLE_GET_DATA(handle,
-                               config,
-                               struct widelinks_config,
-                               return NULL);
-
-       result = SMB_VFS_NEXT_READDIR(handle,
-                                     dirfsp,
-                                     dirp,
-                                     sbuf);
-
-       if (!config->active) {
-               /* Module not active. */
-               return result;
-       }
-
-       /*
-        * Prevent optimization of returning
-        * the stat info. Force caller to go
-        * through our LSTAT that hides symlinks.
-        */
-
-       if (sbuf) {
-               SET_STAT_INVALID(*sbuf);
-       }
-       return result;
-}
-
 static struct vfs_fn_pointers vfs_widelinks_fns = {
        .connect_fn = widelinks_connect,
 
@@ -418,7 +383,6 @@ static struct vfs_fn_pointers vfs_widelinks_fns = {
        .chdir_fn = widelinks_chdir,
        .getwd_fn = widelinks_getwd,
        .realpath_fn = widelinks_realpath,
-       .readdir_fn = widelinks_readdir
 };
 
 static_decl_vfs;
index 56e752109b819d9f0e3444070ee6c244484d7177..89150b37f90a21cc7d5ba0cdbade29fd3d1c6d31 100644 (file)
@@ -849,9 +849,6 @@ const char *vfs_readdirname(connection_struct *conn,
                            void *p,
                            char **talloced)
 {
-       struct stat_ex st = {
-               .st_ex_nlink = 0,
-       };
        struct dirent *ptr= NULL;
        const char *dname;
        char *translated;
@@ -860,7 +857,7 @@ const char *vfs_readdirname(connection_struct *conn,
        if (!p)
                return(NULL);
 
-       ptr = SMB_VFS_READDIR(conn, dirfsp, (DIR *)p, &st);
+       ptr = SMB_VFS_READDIR(conn, dirfsp, (DIR *)p);
        if (!ptr)
                return(NULL);
 
@@ -1493,11 +1490,10 @@ DIR *smb_vfs_call_fdopendir(struct vfs_handle_struct *handle,
 
 struct dirent *smb_vfs_call_readdir(struct vfs_handle_struct *handle,
                                    struct files_struct *dirfsp,
-                                   DIR *dirp,
-                                   SMB_STRUCT_STAT *sbuf)
+                                   DIR *dirp)
 {
        VFS_FIND(readdir);
-       return handle->fns->readdir_fn(handle, dirfsp, dirp, sbuf);
+       return handle->fns->readdir_fn(handle, dirfsp, dirp);
 }
 
 void smb_vfs_call_rewind_dir(struct vfs_handle_struct *handle,