Open akarasik opened 1 week ago
Unfortunately the low level API is very much focused on the primitives of SMB and is designed for single connections to a single server. It is certainly possible to use the same primitives (IOCTL requests with the DFS request payloads) from the low level API but it is up to you to handle the logic around how to parse the requests and create the new connections. DFS is a very complex protocol and I can't even say I've implemented it properly in the high level API. You can see the various branches the client needs to take account of in the protocol docs for MS-DFSC.
Thank you! Is there, by any chance, an example of this implementation using the low level API?
There is not sorry, you'll have to look at how the high level API interacts with it.
Got it, thanks for the information!
Hello!
I am trying to connect to a DFS share using the low-level smbprotocol classes and functions, but it seems to be lacking the ability of getting the referral to be able to get a tree from the right hostname and path. I found that getting the referral is tied to the ClientConfig from smbclient, and I couldn't make it work with the smbprotocol functions.
Is there a way in which smbprotocol can support connecting to DFS shares? or even just getting the referral for future tree usage?
Here are some code snippets for example:
This code works for connecting to the DFS share and getting the files list, due to the fact that scandir eventualy uses the get_smb_tree that converts the hostname to the referral host:
While when running this code results in an exception of
NT_STATUS_BAD_NETWORK_NAME
when executingtree.connect
:Thank you!