Skip to content
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

DFS support in the library #79

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ashutosh-bhole-druva
Copy link

@ashutosh-bhole-druva ashutosh-bhole-druva commented Jul 11, 2023

This PR implements the DFS requests & responses via IOCTL call where we have handled multiple referral entries. Please note that DFS requests are invoked on IPC$.

This enabled us to invoke the Readdir, and other RPC calls using DFS.

NOTE: In the DFS request, if the NAS device is Windows DFS, for converting dirname in the request, we need to append one extra space. If not done, the response is not formed properly. This is not required for DFS based on Nutanix setups. I am not sure why this behavior and need inputs to understand.

Below is the code snippet for the
dfsRefReq := DFSReferralRequest{
MaxReferralLevel: 4,
RequestFileName: fmt.Sprintf("%s ", dfsname), // ---> This works with Windows DFS
//RequestFileName: fmt.Sprintf("%s", dfsname), // ---> This will work with Non-Windows DFS
}

Kindly refer to the example and let me know if any changes are necessary!

This was referenced Jul 11, 2023
@ashutosh-bhole-druva
Copy link
Author

ashutosh-bhole-druva commented Jul 11, 2023

are u going to implement the windows todo?
@tooptoop4 - Windows DFS is implemented. We are just not sure why we need extra space in the DFS request only for Windows DFS systems. If you have a DFS setup on Nutanix, or other systems, then probably you will need to use the other type of request.

dfsRefReq := DFSReferralRequest{
MaxReferralLevel: 4,
RequestFileName: fmt.Sprintf("%s ", dfsname), ---> This works with Windows DFS
//RequestFileName: fmt.Sprintf("%s", dfsname), ----> This will work with Non-Windows DFS
}

Hope this helps

@tooptoop4
Copy link

tooptoop4 commented Jul 11, 2023

@hirochachacha 🦗🌵

@tooptoop4
Copy link

@ashutosh-bhole-druva can u raise the PR in https://github.com/CloudSoda/go-smb2 instead (it seems like an active repo) and I note rclone will use it (rclone/rclone#6733 (comment))?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants