#define FLAGS2_UNICODE_STRINGS 0x8000
/* FileAttributes (search attributes) field */
+#define FILE_ATTRIBUTES_INVALID 0x0000L
#define FILE_ATTRIBUTE_READONLY 0x0001L
#define FILE_ATTRIBUTE_HIDDEN 0x0002L
#define FILE_ATTRIBUTE_SYSTEM 0x0004L
struct timespec st_ex_mtime;
struct timespec st_ex_ctime;
struct timespec st_ex_btime; /* birthtime */
+ uint32_t cached_dos_attributes;
blksize_t st_ex_blksize;
blkcnt_t st_ex_blocks;
* Version 47 - Change SMB_VFS_OPENAT() to match the Linux openat2 prototype, add vfs_open_how
* Version 47 - Add VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS for SMB_VFS_OPENAT()
* Change to Version 48 - will ship with 4.18
+ * Version 48 - Add cached_dos_attributes to struct stat_ex
*/
#define SMB_VFS_INTERFACE_VERSION 48
return FILE_ATTRIBUTE_NORMAL;
}
+ if (fsp->fsp_name->st.cached_dos_attributes != FILE_ATTRIBUTES_INVALID) {
+ return fsp->fsp_name->st.cached_dos_attributes;
+ }
+
/* Get the DOS attributes via the VFS if we can */
status = vfs_fget_dos_attributes(fsp, &result);
if (!NT_STATUS_IS_OK(status)) {
}
}
- result = dos_mode_post(result, fsp, __func__);
- return result;
+ fsp->fsp_name->st.cached_dos_attributes = dos_mode_post(result, fsp, __func__);
+ return fsp->fsp_name->st.cached_dos_attributes;
}
struct dos_mode_at_state {
}
if (NT_STATUS_IS_OK(status)) {
+ smb_fname->st.cached_dos_attributes = dosmode;
ret = 0;
goto done;
}
FILE_NOTIFY_CHANGE_ATTRIBUTES,
fsp->fsp_name->base_name);
+ fsp->fsp_name->st.cached_dos_attributes = new_dosmode;
fsp->fsp_flags.is_sparse = sparse;
return NT_STATUS_OK;
}
req->chain_fsp = fsp;
+ fsp->fsp_name->st.cached_dos_attributes = FILE_ATTRIBUTES_INVALID;
return fsp;
}
return NULL;
}
+ fsp->fsp_name->st.cached_dos_attributes = FILE_ATTRIBUTES_INVALID;
+
return fsp;
}
if (smb2req->compat_chain_fsp->fsp_flags.closing) {
return NULL;
}
+ smb2req->compat_chain_fsp->fsp_name->st.cached_dos_attributes =
+ FILE_ATTRIBUTES_INVALID;
return smb2req->compat_chain_fsp;
}
fsp->name_hash = name_hash;
fsp->fsp_name = smb_fname_new;
+ fsp->fsp_name->st.cached_dos_attributes = FILE_ATTRIBUTES_INVALID;
*_smb_fname = NULL;
return NT_STATUS_OK;
}