Skip to content

smb2_get_error "Tree Connect failed with (0xc0000022) STATUS_ACCESS_DENIED" while using negotiate version 0311 to connect some linux servers. #209

Closed
@Arlen-LT

Description

@Arlen-LT

I pull from commit d8c85a3. My code is:

    smb2_context* smb2 = smb2_init_context();
    smb2_set_security_mode(smb2, SMB2_NEGOTIATE_SIGNING_ENABLED);
    smb2_set_timeout(smb2, 3);
    int ret = smb2_connect_share(smb2, ip, share, userID, password);
    if(ret < 0)
    {
        Log("%s\n", smb2_get_error(smb2));
        smb2_disconnect_share(smb2);
        smb2_destroy_context(smb2);
        smb2 = nullptr;
    }

and the error message is Tree Connect failed with (0xc0000022) STATUS_ACCESS_DENIED.
I tried to use smb2_set_version(smb2, SMB2_VERSION_0302); or any other negotiate version below SMB2_VERSION_0311 and connect successfully.
Could someone give me some advice? Thanks a lot.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions