-
Notifications
You must be signed in to change notification settings - Fork 105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Information question about method SmbTreeConnection.send0() #351
Comments
The loop is meant to handle the STATUS_PATH_NOT_COVERED error by requesting the DFS referral and update the path accordingly. If that fails and the same path is requested over and over, you have hit a bug. |
Thanks for the answer. Yes, it fails 10 times with STATUS_PATH_NOT_COVERED for exactly the same path before trying a different path, with success. Then it fails again 10 times with STATUS_PATH_NOT_COVERED for a path that is different from the previous 10 attempts. And again, the path stays the same for all 10 attempts. So OK, it is a bug. The thing is: in my tests I have hit quite a number of problems which are showstoppers for me. SmbTreeConnection.send0() tries the same path 10 times in the row and fails. It is not very useful I think. I have a better idea. Maybe you find it useful as well. First, some context: our software uses commons-vfs2 with org.codelib:jcifs dependency. Before I continue, I have a question: what is the real difference between org.codelib:jcifs and jcifs-ng? What I can see here https://github.com/codelibs/jcifs/#this-jcifs-or-jcifs-ng is not really an answer to this question. I mean looking at it I would not be able to decide which of the two are better for my project. Back to the context: our software did not work. It failed with authentication problems. smbclient worked with the same credentials. This was a starting point for me: I was asked to look at it. Fortunately I was also given permission to run tcpdump at the client side. To simplify the investigation I have written a very small test program that connects to a specified url (directory) and lists its contents. First it started with commons-vfs2, but then I changed it to use jcifs directly. Analyzing the first 10 or so tcpdumps of smbclient resulted in questions #350 Just for info: smbj based variant still did not work. Authentication was successful then, but it failed on Tree Connect Request after that. Both jcifs variants worked with the URL of the share, but not for sibdirectories of the share. I had to start small, directory by directory. It did not work, I looked at debug output and tcpdumps, trying to figure out what was wrong. I patched org.codelib:jcifs according to my understanding of the problem. It was actually very bad. It took a day to get it working for the first subdirectory. It took another day for the next subdirectory. I am not exaggerating. After that I hit "Loop in DFS referrals" , and after increasing jcifs.smb.client.maxRequestRetries I finally managed to list the contents of the directory the client specified. So back to my idea: I had to made quite a number of patches. The problems I "fixed" include:
I use "fixed" in quotes because I do not know for sure if my fixes are correct. I was just trying to make my test program work. For the changes I made I can create individual pull requests for jcifs-ng. The changes include also some comments where I explain why I did it or wondered about a particular piece of code. You can then review my changes, maybe accept some of them or just make the fixes yourself. Or maybe you will have some comments about particular changes... I also hit several problems that did not make my test program fail, but which are in my view signs of bugs:
I would like to see them fixed as well. The last one seems very dangerous to me. it smells like resource leak, which is a big problem for a long running program. This is what I will try to investigate next. If you have any suggestions what to look for to resolve these 3 problems I would like to hear them. |
In my tests I see 10 attempts fail (Create request fails with STATUS_PATH_NOT_COVERED).
After that I see a slightly different Ioctl Request FSCTL_DFS_GET_REFERRALS + Tree Connect \APPSDATA$, and then Create request succeeds.
Why the method loops 10 times?
The text was updated successfully, but these errors were encountered: