Read-Only files hosted on a Unisys MCP fileserver cannot be deleted with a windows client (XP SP2 and later)


Symptoms


A Windows computer that is running Windows XP SP2 or later (Windows Server 2003, Windows Vista, Windows 7) attempts to delete a file that is saved on a Unisys MCP file server. It appears to the user that the file has been deleted, (e.g. the file disappears from the Explorer window, or from the Command Prompt, and no error is returned) but in fact, the file has not been deleted.

Cause


The Windows SMB redirector client receives an Access Denied error from the remote Unisys MCP Server because the file is a read-only file. This is the expected and documented behavior for the SMB DELETE command when trying to delete a read-only file. However, the error is not passed back from the redirector to Windows Explorer; rather, the redirector returns a success. Both Windows Explorer and the Command Prompt act as if the file has been deleted because the redirector said that it had. The file, though, was not deleted.

Typically, Windows Explorer will check to see if the file is read-only, clear the read-only bit then attempt to delete it again, which would be successful in the problem scenario, or it would return an error. The Command Prompt will typically return an error indicating the reason for the failure. The functionality fails, though, because the redirector never returns the Access Denied error.

Resolution


The read-only attribute on the file must be manually removed before the file can be deleted. If the read-only attribute is removed, then the file can be deleted as expected.

More Information


Steps to reproduce the issue
=============================
Setup a file share on a Unisys MCP server with a read-only file stored on this share. Connect to the share from a Windows machine that is running an OS that is later than Windows XP SP2. Attempt to delete the file. It will appear that the file has been deleted, but if you refresh the Explorer view of the file share or execute a DIR of the folder at a Command Prompt, you will see that the file has not been deleted.
 
The network trace excerpts below show examples of the behavior between the client and Unisys file server.

Windows XP Service Pack 1 behavior (the problem does not occur):

SMB SMB:C; Delete, File = \filename.txt
SMB SMB:C; Open Andx, FileName = \filename.txt
SMB SMB:R; Delete - DOS OS Error, (5) ACCESS_DENIED
SMB SMB:R; Open Andx, FID = 0x0107 (\filename.txt), ServerFID = 0x0
TCP TCP:Flags=...A...., SrcPort=1035, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=2044006109, Ack=1532242171, Win=65029 (scale factor 0x0) = 65029
SMB SMB:C; Set Information, FileName = \filename.txt
SMB SMB:R; Set Information, FileName = \filename.txt
SMB SMB:C; Close, FID = 0x0107 , FileName=\filename.txt
SMB SMB:R; Close, FID = 0x0107 , FileName=\filename.txt
SMB SMB:C; Query Information, FileName = \filename.txt
SMB SMB:R; Query Information, FileName = \filename.txt
SMB SMB:C; Delete, File = \filename.txt
SMB SMB:R; Delete

Windows XP Service Pack 2 and later behavior (the problem occurs):

SMB SMB:C; Delete, File = \filename.txt
SMB SMB:R; Delete, FID = 0x0101 - DOS OS Error, (5) ACCESS_DENIED
TCP TCP:Flags=...A...., SrcPort=1080, DstPort=Microsoft-DS(445), PayloadLen=0, Seq=3829405854, Ack=638341921, Win=64966 (scale factor 0x0) = 64966