Change struct stat st -> SMB_STRUCT_STAT st
and just copy the struct on success, as sys_fstatat()
already does the init_stat_ex_from_stat() for us.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
struct dirent *result;
bool fake_ctime = lp_fake_directory_create_times(SNUM(handle->conn));
int flags = AT_SYMLINK_NOFOLLOW;
- struct stat st;
+ SMB_STRUCT_STAT st;
int ret;
START_PROFILE(syscall_readdir);
*/
SET_STAT_INVALID(*sbuf);
- ret = fstatat(dirfd(dirp),
+ ret = sys_fstatat(dirfd(dirp),
result->d_name,
&st,
- flags);
+ flags,
+ fake_ctime);
if (ret != 0) {
return result;
}
* as we don't know if they wanted the link info, or its
* target info.
*/
- if (S_ISLNK(st.st_mode) &&
+ if (S_ISLNK(st.st_ex_mode) &&
!(dirfsp->fsp_name->flags & SMB_FILENAME_POSIX_PATH))
{
return result;
}
- init_stat_ex_from_stat(sbuf, &st, fake_ctime);
+ *sbuf = st;
return result;
}