return ret;
}
+static int vfs_gpfs_fstat(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ SMB_STRUCT_STAT *sbuf)
+{
+ int ret;
+
+ ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
+ if (ret == -1 && errno == EACCES) {
+ bool fake_dctime =
+ lp_fake_directory_create_times(SNUM(handle->conn));
+
+ DBG_DEBUG("fstat for %s failed with EACCES. Trying with "
+ "CAP_DAC_OVERRIDE.\n", fsp->fsp_name->base_name);
+ ret = fstatat_with_cap_dac_override(fsp_get_pathref_fd(fsp),
+ "",
+ sbuf,
+ AT_EMPTY_PATH,
+ fake_dctime);
+ }
+
+ return ret;
+}
+
static int vfs_gpfs_lstat(struct vfs_handle_struct *handle,
struct smb_filename *smb_fname)
{
.fchmod_fn = vfs_gpfs_fchmod,
.close_fn = vfs_gpfs_close,
.stat_fn = vfs_gpfs_stat,
+ .fstat_fn = vfs_gpfs_fstat,
.lstat_fn = vfs_gpfs_lstat,
.fntimes_fn = vfs_gpfs_fntimes,
.aio_force_fn = vfs_gpfs_aio_force,