-
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
Failed to create child URL when trying to list shares #211
Comments
As a workaround I changed the servername for "" so the alignment is the same regardless of the server name. According to the spec, this is a valid value. I've checked again and yes, you are doing the alignment before inserting the long value (this.level), so the calculation may be wrong on the jlan side |
If you have a jlan demo server available, that would be much appreciated. |
Here you can find the jlan server : https://sourceforge.net/projects/alfresco/files/JLAN/Alfresco%20JLAN%205.0/ The code is already built, you only need to set the broadcast address in jlanConfig.xml, then run: This is my test client In my original post you can find the relevant client and server classes. As a summary of that post, what I did found is that the base offset for the alignment is different for jcifs and jlan, and in this case there is a two byte difference between both, causing the issue |
While I did not get as far as trying the jLAN serer, I think there is a good chance this is caused by the issue described in #210. Could you try master and verify? |
I've tested it and it still have the same issue :-(
GRAVE: Failed to create child URL
java.net.MalformedURLException: Name must not be empty
at jcifs.smb.SmbFile.checkName(SmbFile.java:587)
at jcifs.smb.SmbFile.<init>(SmbFile.java:466)
at jcifs.smb.ShareEnumIterator.adapt(ShareEnumIterator.java:93)
at jcifs.smb.ShareEnumIterator.advance(ShareEnumIterator.java:66)
at jcifs.smb.ShareEnumIterator.<init>(ShareEnumIterator.java:54)
at jcifs.smb.SmbEnumerationUtil.doShareEnum(SmbEnumerationUtil.java:173)
at jcifs.smb.SmbEnumerationUtil.doEnum(SmbEnumerationUtil.java:218)
at jcifs.smb.SmbEnumerationUtil.listFiles(SmbEnumerationUtil.java:279)
at jcifs.smb.SmbFile.listFiles(SmbFile.java:1206)
at smb.test.Test.main(Test.java:19)
El lun., 13 abr. 2020 a las 13:14, Moritz Bechler (<notifications@github.com>)
escribió:
… While I did not get as far as trying the jLAN serer, I think there is a
good chance this is caused by the issue described in #210
<#210>. Could you try master and
verify?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#211 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACY2EYT6LUKEWKQDDGUZM5DRMNB5TANCNFSM4LO6BLQA>
.
--
Franco Catrin
http://retrox.tv
|
Thanks for checking, I will have another go at this, hopefully soon. |
Turns out the SMB_COM_TRANSACTION padding algorithm has been wrong all the time (padding two 2 bytes among other things). So this was caused by missing padding before the NetShareEnum structure. |
Please try 593b674 |
I ran my test and it worked fine. It seems to be fixed now |
I'm having the following exception when trying to list shares from an Nvidia Shield TV device
Using smbclient and nautilus on Linux I can browse that device without issues.
I've been digging into this problem and I found the cause, but I don't have enough knowledge to know if the problem is in jcifs or it is in the server included with the Nvidia Shield TV which is Alfresco jlan.
What I've found is that within the NetShareEnumAll request (name used by wireshark), just after the server name, jlan expect a 4 byte alignment of the next value, which is the data for Info Level in that request. But in the jcifs code there is no such alignment inserted (class ShareEnumAll, method encode_in). Here is an extract of jcifs:
And here is an extract from the server code in jlan (class DCEBuffer, method getString)
where align is a 4 byte alignment.
Without the right alignment, the 32 bit value 01 00 00 00 sent by jcifs is read as 00 00 01 00 by jlan and marked as invalid thus returning error code 02 (WERR_FILE_NOT_FOUND), causing an empty response with jcifs throwing the exception that I put at the beginning.
If I force jcifs to do the alignment, the value is read as 1 by jlan and the share list is returned.
Now, the alignment does not always solve the issue, and this is the part where I got lost. I've seen that jcifs is using the NdrBuffer start address as the base address to calculate the current position to do the alignment (gives around offset 64), while jlan is using the container message as the base address (gives around offset 152), so the alignment fails depending on the info in that message.
The bug totally depends on random factors like the name of the target device, so it may work or it may fail depending on the network name lengths. I tried to look the samba code considering that it always work with that jlan server to see how they do the alignment but without success, it's just too big as a codebase for me right now.
I can prepare an easy test bundle with jlan + jcifs ready to run the test in a unix machine if you need it.
The text was updated successfully, but these errors were encountered: