const char *dpath = dirptr->smb_dname->base_name;
bool dirptr_path_is_dot = ISDOT(dpath);
NTSTATUS status;
+ int ret;
*_smb_fname = NULL;
*_mode = 0;
return false;
}
+ if (!VALID_STAT(smb_fname->st)) {
+ /*
+ * If stat() fails with ENOENT it might be a
+ * msdfs-symlink in Windows context, this is checked
+ * below, for now we just want to fill stat info as good
+ * as we can.
+ */
+ ret = vfs_stat(conn, smb_fname);
+ if (ret != 0 && errno != ENOENT) {
+ TALLOC_FREE(smb_fname);
+ TALLOC_FREE(dname);
+ TALLOC_FREE(fname);
+ continue;
+ }
+ }
+
/* Create smb_fname with NULL stream_name. */
atname = synthetic_smb_fname(talloc_tos(),
dname,
NULL,
- &sbuf,
+ &smb_fname->st,
dirptr->smb_dname->twrp,
dirptr->smb_dname->flags);
if (atname == NULL) {