Checked NTFS version before setting a reparse point

N2009_11_14_FIXES
jpandre 2009-04-03 06:55:28 +00:00
parent 03755a9ba5
commit 9836e3f22d
1 changed files with 13 additions and 5 deletions

View File

@ -953,12 +953,20 @@ int ntfs_set_ntfs_reparse_data(const char *path __attribute__((unused)),
/*
* no reparse data attribute : add one,
* apparently, this does not feed the new value in
* Note : NTFS version must be >= 3
*/
res = ntfs_attr_add(ni,AT_REPARSE_POINT,
AT_UNNAMED,0,(u8*)NULL,(s64)size);
if (!res)
ni->flags |= FILE_ATTR_REPARSE_POINT;
NInoSetDirty(ni);
if (ni->vol->major_ver >= 3) {
res = ntfs_attr_add(ni,AT_REPARSE_POINT,
AT_UNNAMED,0,(u8*)NULL,
(s64)size);
if (!res)
ni->flags
|= FILE_ATTR_REPARSE_POINT;
NInoSetDirty(ni);
} else {
errno = EOPNOTSUPP;
res = -1;
}
} else {
errno = ENODATA;
res = -1;