From 9836e3f22d40544824a7972175cce81b52b1a863 Mon Sep 17 00:00:00 2001 From: jpandre Date: Fri, 3 Apr 2009 06:55:28 +0000 Subject: [PATCH] Checked NTFS version before setting a reparse point --- libntfs-3g/reparse.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/libntfs-3g/reparse.c b/libntfs-3g/reparse.c index c7e53618..cfaffcfe 100644 --- a/libntfs-3g/reparse.c +++ b/libntfs-3g/reparse.c @@ -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;