Recent versions of windows add a whole bunch of attributes above
A_ARCH. (FILE_ATTRIBUTE_NOT_CONTENT_INDEXED was what bit be but
encryption of compression would do it).
This makes ~_A_ARCH not a good choice for testing nonwritability
of a file - so files with these new attributes just get silently ignored.
Using an explicit mask is much better. So do that.
Change-Id: Ie176ffae1995dd50c70319e196c0d30420733ccf
Reviewed-on: http://gerrit.openafs.org/3182
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
exit(1);
}
+/*
+ * Construct the mask explicitly. Later versions of windows start filling
+ * in higher bits and that doesn't affect the operation
+ */
+
+#define ATTRIBUTE_MASK (_A_RDONLY | _A_HIDDEN | _A_SYSTEM | _A_SUBDIR)
+
+
int
main(int argc, char *argv[])
{
return 0;
do {
- if ((finfo.attrib & ~_A_ARCH) != _A_NORMAL)
+ if ((finfo.attrib & ATTRIBUTE_MASK) != _A_NORMAL)
continue;
fh = _open(finfo.name, _S_IWRITE | _O_BINARY | _S_IREAD | _O_RDWR);
pos = _lseek(fh, 0L, SEEK_END);