Changes by: antona
Update of /cvsroot/linux-ntfs/ntfsprogs/libntfs
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv906/libntfs
Modified Files:
attrib.c
Log Message:
Cope with attribute list attribute having invalid flags. Windows
copes with this and even chkdsk does not detect or fix this so we
have to cope with it, too. Thanks to a Pawel for reporting the
problem. (Anton)
Index: attrib.c
===================================================================
RCS file: /cvsroot/linux-ntfs/ntfsprogs/libntfs/attrib.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -u -p -r1.210 -r1.211
--- attrib.c 21 Feb 2006 18:57:34 -0000 1.210
+++ attrib.c 24 Feb 2006 09:20:13 -0000 1.211
@@ -104,7 +104,12 @@ s64 ntfs_get_attribute_value(const ntfs_
return 0;
}
/* Complex attribute? */
- if (a->flags) {
+ /*
+ * Ignore the flags in case they are not zero for an attribute list
+ * attribute. Windows does not complain about invalid flags and chkdsk
+ * does not detect or fix them so we need to cope with it, too.
+ */
+ if (a->type != AT_ATTRIBUTE_LIST && a->flags) {
ntfs_log_error("Non-zero (%04x) attribute flags. Cannot handle "
"this yet.\n", le16_to_cpu(a->flags));
errno = EOPNOTSUPP;
@@ -380,6 +385,13 @@ ntfs_attr *ntfs_attr_open(ntfs_inode *ni
}
a = ctx->attr;
+ /*
+ * Wipe the flags in case they are not zero for an attribute list
+ * attribute. Windows does not complain about invalid flags and chkdsk
+ * does not detect or fix them so we need to cope with it, too.
+ */
+ if (type == AT_ATTRIBUTE_LIST)
+ a->flags = 0;
cs = a->flags & (ATTR_IS_COMPRESSED | ATTR_IS_SPARSE);
if (!name) {
if (a->name_length) {
|