-
Notifications
You must be signed in to change notification settings - Fork 26
Open
Description
in class org.filesys.smb.server.disk.original.JavaFileDiskDriver.deleteDirectory line 267
String[] fileList = delDir.list();
if (fileList != null && fileList.length > 0) {
throw new AccessDeniedException("Directory not empty");
} else {
// Delete the directory
delDir.delete();
}
In order to be able to delete non-empty folders directly,I changed the above code to
String[] fileList = delDir.list();
if (fileList != null && fileList.length > 0) {
//throw new AccessDeniedException("Directory not empty");
deleteFolder(delDir); //Recursive deletion
} else {
// Delete the directory
delDir.delete();
}
private static void deleteFolder(File folder) {
File[] files = folder.listFiles();
if (files != null) {
for (File file : files) {
if (file.isDirectory()) {
deleteFolder(file);
} else {
file.delete();
}
}
}
folder.delete();
}
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

Metadata
Metadata
Assignees
Labels
No labels