This is subtle: we inherit the smb_fname flags from the directory to its
directory entries while listing a directory. This means if were listing a
directory in POSIX context, we now treat all entries as POSIX paths and
correctly call lstat() on the entries instead of stat().
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
/* Create an smb_filename with stream_name == NULL. */
smb_fname_base = (struct smb_filename) {
.base_name = pathreal,
+ .flags = dptr->dir_hnd->fsp->fsp_name->flags,
.twrp = dptr->smb_dname->twrp,
};
- if (SMB_VFS_STAT(dptr->conn, &smb_fname_base) == 0) {
+ if (vfs_stat(dptr->conn, &smb_fname_base) == 0) {
*pst = smb_fname_base.st;
name = talloc_strdup(ctx, dptr->wcard);
goto clean;