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

Smb2Client ListShares and TreeConnect fail when using dll built with SMB311_CLIENT #285

Open
DevDevDeveolper opened this issue Jan 5, 2025 · 1 comment

Comments

@DevDevDeveolper
Copy link

DevDevDeveolper commented Jan 5, 2025

Hi,

When I use 1.5.3.5 built by myself without extra constants or with SMB302_CLIENT, everything works fine.

Once I define both SMB302_CLIENT and SMB311_CLIENT, it fails regarding ListShares or TreeConnect for SMB servers, even if they are not requiring SMB 3.11. This happened on smbd 4.19.5 on Ubuntu 24.04 with min_protocol SMB3_00, SMB3_02, SMB3_11 and on a Windows 11 shared folder.

private string ipAddress = "192.xx.xx.xx";
private string username = "username";
private string password = "password";
...
SMB2Client smb2Client = new SMB2Client();
bool isConnected = smb2Client.Connect(IPAddress.Parse(ipAddress), SMBTransportType.DirectTCPTransport);

NTStatus ntStatus = smb2Client.Login(String.Empty, username, password);  

if(ntStatus == NTStatus.STATUS_SUCCESS) {            
            List<string> shares = smb2Client.ListShares(out ntStatus);
            ...
}

It does connect, it does login, but then for ListShares the ntStatus is STATUS_ACCESS_DENIED.

Knowing what share should have been reported, I tried TreeConnect, which gives the same status message of STATUS_ACCESS_DENIED.

ISMBFileStore fileStore = smb2Client.TreeConnect(shareName, out ntStatus);

When I replace the dlls built with SMB302_CLIENT and SMB311_CLIENT with the ones built only with SMB302_CLIENT, the same code works without issues.

Do you have any advice? Is something missing?

Thanks!

@TalAloni
Copy link
Owner

TalAloni commented Jan 5, 2025

SMB 3.11 client support is experimental, but it should work.
I will try to find time to recreate this.

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

No branches or pull requests

2 participants