mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 10:04:00 +08:00
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:
parent
8073ab6764
commit
172da09947
@ -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
|
* EA and REPARSE_POINT compatibility not checked any more,
|
||||||
* see http://msdn.microsoft.com/en-us/library/windows/desktop/aa364404(v=vs.85).aspx
|
* required by Windows 10, but having both may lead to
|
||||||
* Also return EINVAL if REPARSE_POINT is present.
|
* problems with earlier versions.
|
||||||
*/
|
*/
|
||||||
if (ok
|
if (ok) {
|
||||||
&& !ntfs_attr_exist(ni, AT_REPARSE_POINT, AT_UNNAMED,0)) {
|
|
||||||
ea_info.ea_length = cpu_to_le16(ea_packed);
|
ea_info.ea_length = cpu_to_le16(ea_packed);
|
||||||
ea_info.need_ea_count = cpu_to_le16(ea_count);
|
ea_info.need_ea_count = cpu_to_le16(ea_count);
|
||||||
ea_info.ea_query_length = cpu_to_le32(nextoffs);
|
ea_info.ea_query_length = cpu_to_le32(nextoffs);
|
||||||
|
@ -1197,11 +1197,12 @@ int ntfs_set_ntfs_reparse_data(ntfs_inode *ni,
|
|||||||
ntfs_index_context *xr;
|
ntfs_index_context *xr;
|
||||||
|
|
||||||
res = 0;
|
res = 0;
|
||||||
/* reparse data is not compatible with EA */
|
/*
|
||||||
if (ni
|
* reparse data compatibily with EA is not checked
|
||||||
&& !ntfs_attr_exist(ni, AT_EA_INFORMATION, AT_UNNAMED, 0)
|
* any more, it is required by Windows 10, but may
|
||||||
&& !ntfs_attr_exist(ni, AT_EA, AT_UNNAMED, 0)
|
* lead to problems with earlier versions.
|
||||||
&& valid_reparse_data(ni, (const REPARSE_POINT*)value, size)) {
|
*/
|
||||||
|
if (ni && valid_reparse_data(ni, (const REPARSE_POINT*)value, size)) {
|
||||||
xr = open_reparse_index(ni->vol);
|
xr = open_reparse_index(ni->vol);
|
||||||
if (xr) {
|
if (xr) {
|
||||||
if (!ntfs_attr_exist(ni,AT_REPARSE_POINT,
|
if (!ntfs_attr_exist(ni,AT_REPARSE_POINT,
|
||||||
|
Loading…
Reference in New Issue
Block a user