Windows: Deny writes/truncation to files w RO attr
authorJeffrey Altman <jaltman@your-file-system.com>
Fri, 4 Apr 2014 20:42:36 +0000 (16:42 -0400)
committerJeffrey Altman <jaltman@your-file-system.com>
Thu, 17 Apr 2014 04:10:14 +0000 (21:10 -0700)
commitdd8d2aa871fc5841c281d1292c39ffb8edf1ebd1
treec0fa21f6b5f1e89f210934738dd226116a6a7617
parente24ed842eba54f62105b08d2b9fb281cc19519f1
Windows: Deny writes/truncation to files w RO attr

If the readonly file attribute is set on a file, refuse to process
writes, truncations or overwrites.   The afsd_service will do so
and this can lead to data corruption.

At the same time, writes from the redirector to afsd_service must
not be denied because of the readonly attribute.  That check was
performed during the CreateFile.   Otherwise, a new file can be
created with the readonly attribute and then not be writable.

Change-Id: I921a11eb8c1a3e642d60c23fc905b3febc0f0761
Reviewed-on: http://gerrit.openafs.org/10985
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
src/WINNT/afsrdr/kernel/lib/AFSCreate.cpp
src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp
src/WINNT/afsrdr/user/RDRFunction.c