s3: expect fstatat() and dirfd()
authorRalph Boehme <slow@samba.org>
Tue, 13 Jul 2021 16:03:31 +0000 (09:03 -0700)
committerRalph Boehme <slow@samba.org>
Wed, 14 Jul 2021 08:09:31 +0000 (08:09 +0000)
FreeBSD, AIX and Solaris all have this.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_default.c
source3/modules/vfs_gpfs.c
source3/wscript

index e4f6510ec0b60f283282d4f4a460607c24f41833..67253702432368dcd564bb4be7ae167e79e11cc7 100644 (file)
@@ -581,7 +581,6 @@ static struct dirent *vfswrap_readdir(vfs_handle_struct *handle,
                                      SMB_STRUCT_STAT *sbuf)
 {
        struct dirent *result;
-       bool do_stat = false;
        bool fake_ctime = lp_fake_directory_create_times(SNUM(handle->conn));
        int flags = AT_SYMLINK_NOFOLLOW;
        struct stat st;
@@ -589,10 +588,6 @@ static struct dirent *vfswrap_readdir(vfs_handle_struct *handle,
 
        START_PROFILE(syscall_readdir);
 
-#if defined(HAVE_DIRFD) && defined(HAVE_FSTATAT)
-       do_stat = true;
-#endif
-
        result = readdir(dirp);
        END_PROFILE(syscall_readdir);
 
@@ -609,11 +604,6 @@ static struct dirent *vfswrap_readdir(vfs_handle_struct *handle,
         */
        SET_STAT_INVALID(*sbuf);
 
-       /* See if we can efficiently return this. */
-       if (!do_stat) {
-               return result;
-       }
-
        ret = fstatat(dirfd(dirp),
                      result->d_name,
                      &st,
index 6acdc9129b73f753cb967cdf027a7d54c5a14198..d74bc43db0e098de1678f35d1100a12f120ffafa 100644 (file)
@@ -1573,7 +1573,6 @@ static NTSTATUS vfs_gpfs_fset_dos_attributes(struct vfs_handle_struct *handle,
 static int stat_with_capability(struct vfs_handle_struct *handle,
                                struct smb_filename *smb_fname, int flag)
 {
-#if defined(HAVE_FSTATAT)
        int fd = -1;
        NTSTATUS status;
        struct smb_filename *dir_name = NULL;
@@ -1611,9 +1610,6 @@ static int stat_with_capability(struct vfs_handle_struct *handle,
        }
 
        return ret;
-#else
-       return -1;
-#endif
 }
 
 static int vfs_gpfs_stat(struct vfs_handle_struct *handle,
index c7434fedb92856cd2a1afdb4c9a0df1ed7ccafb1..87dbc00f1911048c2087944608fa396fc679dca6 100644 (file)
@@ -134,7 +134,6 @@ def configure(conf):
     conf.CHECK_FUNCS('fseeko setluid')
     conf.CHECK_FUNCS('getpwnam', headers='sys/types.h pwd.h')
     conf.CHECK_FUNCS('fdopendir')
-    conf.CHECK_FUNCS('fstatat')
     conf.CHECK_FUNCS('getpwent_r setenv clearenv strcasecmp')
     conf.CHECK_FUNCS('syslog vsyslog timegm setlocale')
     conf.CHECK_FUNCS('lutimes utimensat futimens')
@@ -388,7 +387,6 @@ fchflags
 chmod
 crypt16
 devnm
-dirfd
 endmntent
 execl
 fchmod