This is not a major bug. This is expected behavior if you do not open for data access. This is the way it has always worked.
Full stop. Go disassemble IoUpdateShareAccess and IoCheckShareAccess on NT 3.51 if you want.
Ask for data access and the user won’t be able to delete the file.
I am getting more and more confused …
First of all, what do we mean by “deleting an open file” here? On my books, it means that you have opened a file handle for some access
(for example, FILE_READ_ATTRIBUTES or FILE_WRITE_EA), and then, once in a sudden, you are unable to perform the requested operation because the target file has been deleted, although a handle to it is still open. If this is the case, then we are speaking about a major bug.
However, if you have opened a file handle for,say, FILE_READ_ATTRIBUTES access, and then, at some point, discover that you cannot read file data because the target file has been deleted…well, then this is simply a non-issue, at least on my books. After all, if you have opened a file for reading file attributes, you should not read or write its data, even if IO manager does not explicitly prohibit it. More on it below.
The fact that you can request no data access but still read/write the file object is an artifact of the way the I/O subsystem works
(access check is done at the NT API level
Well, in such case you are doing something that you are not supposed to, so that you have to either make sure you know what you are actually doing, or to be ready to deal with the potential “consequences” if something goes not the way you have planned. Therefore, all your possible complaints are simply pointless in this situation.
So my question to Jamey is “which scenario are we speaking about on this thread”? If we are speaking about the latter one, it means that this thread has been nonsensical right from the original post
Anton Bassov