Dropped rejecting having both EA and reparse data

Windows traditionally rejected having both EA and reparse data assigned
to a file, but Windows 10 has dropped the constraint and it uses this
condition massively, so do the same. Note that pre-Windows 10 chkdsk.exe
removes the EA' on reparse points, potentially damaging more recent
volumes.
This commit is contained in:
Jean-Pierre André 2021-01-26 10:06:17 +01:00
parent 8073ab6764
commit 172da09947
2 changed files with 10 additions and 10 deletions

View File

@ -293,12 +293,11 @@ int ntfs_set_ntfs_ea(ntfs_inode *ni, const char *value, size_t size, int flags)
}
}
/*
* EA and REPARSE_POINT exclude each other
* see http://msdn.microsoft.com/en-us/library/windows/desktop/aa364404(v=vs.85).aspx
* Also return EINVAL if REPARSE_POINT is present.
* EA and REPARSE_POINT compatibility not checked any more,
* required by Windows 10, but having both may lead to
* problems with earlier versions.
*/
if (ok
&& !ntfs_attr_exist(ni, AT_REPARSE_POINT, AT_UNNAMED,0)) {
if (ok) {
ea_info.ea_length = cpu_to_le16(ea_packed);
ea_info.need_ea_count = cpu_to_le16(ea_count);
ea_info.ea_query_length = cpu_to_le32(nextoffs);

View File

@ -1197,11 +1197,12 @@ int ntfs_set_ntfs_reparse_data(ntfs_inode *ni,
ntfs_index_context *xr;
res = 0;
/* reparse data is not compatible with EA */
if (ni
&& !ntfs_attr_exist(ni, AT_EA_INFORMATION, AT_UNNAMED, 0)
&& !ntfs_attr_exist(ni, AT_EA, AT_UNNAMED, 0)
&& valid_reparse_data(ni, (const REPARSE_POINT*)value, size)) {
/*
* reparse data compatibily with EA is not checked
* any more, it is required by Windows 10, but may
* lead to problems with earlier versions.
*/
if (ni && valid_reparse_data(ni, (const REPARSE_POINT*)value, size)) {
xr = open_reparse_index(ni->vol);
if (xr) {
if (!ntfs_attr_exist(ni,AT_REPARSE_POINT,