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.
Reviewed-on: http://gerrit.openafs.org/3182
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>
(cherry picked from commit
68aace4054430105ceaf52ce8e316f3ae01e7dc8)
Change-Id: Ia481b1b36dbecbeca5a9e69dbcd78b7a754f9cc9
Reviewed-on: http://gerrit.openafs.org/3239
Tested-by: BuildBot <buildbot@rampaginggeek.com>
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);