From: Ralph Boehme Date: Tue, 13 Jul 2021 16:03:31 +0000 (-0700) Subject: s3: expect fstatat() and dirfd() X-Git-Tag: talloc-2.3.3~71 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f66d3621f5e7f9549a52b975e59a4984726ec58d;p=thirdparty%2Fsamba.git s3: expect fstatat() and dirfd() FreeBSD, AIX and Solaris all have this. Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/modules/vfs_default.c b/source3/modules/vfs_default.c index e4f6510ec0b..67253702432 100644 --- a/source3/modules/vfs_default.c +++ b/source3/modules/vfs_default.c @@ -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, diff --git a/source3/modules/vfs_gpfs.c b/source3/modules/vfs_gpfs.c index 6acdc9129b7..d74bc43db0e 100644 --- a/source3/modules/vfs_gpfs.c +++ b/source3/modules/vfs_gpfs.c @@ -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, diff --git a/source3/wscript b/source3/wscript index c7434fedb92..87dbc00f191 100644 --- a/source3/wscript +++ b/source3/wscript @@ -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