Open zglqaq opened 10 months ago
This looks like SMB1 traffic, according to the spec the DeleteDirectory request should return a STATUS_DIRECTORY_NOT_EMPTY if there are files/folders within the folder being deleted. The Java File delete() method will throw an exception if there are files/folders in the folder you are trying to delete.
It's usually up to the client to deal with the non-empty folder.
I've not done any work with the SMB1 code for quite a while as Windows clients have switched SMB1 off, using the more efficient and secure SMB2/SMB3 protocols.
in class org.filesys.smb.server.disk.original.JavaFileDiskDriver.deleteDirectory line 267
In order to be able to delete non-empty folders directly,I changed the above code to
After the modification, the non-empty folder can be successfully deleted on the client.
But when I cut the non-empty folder on the client, the client only cut the empty folder, there is no content in it, and the server folder was completely deleted.
I used the packet capture tool to analyze the data message and found that the client did not send the ReadAndX(0x2e) command