mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r2494: fixed connecting to a share mode server (tested and really works now)
This commit is contained in:
parent
0d5af5b70b
commit
25f725c9be
@ -83,7 +83,11 @@ NTSTATUS smbcli_session_setup(struct smbcli_state *cli,
|
|||||||
setup.generic.in.domain = "";
|
setup.generic.in.domain = "";
|
||||||
setup.generic.in.capabilities &= ~CAP_EXTENDED_SECURITY;
|
setup.generic.in.capabilities &= ~CAP_EXTENDED_SECURITY;
|
||||||
} else {
|
} else {
|
||||||
setup.generic.in.password = password;
|
if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_USER_LEVEL) {
|
||||||
|
setup.generic.in.password = password;
|
||||||
|
} else {
|
||||||
|
setup.generic.in.password = NULL;
|
||||||
|
}
|
||||||
setup.generic.in.user = user;
|
setup.generic.in.user = user;
|
||||||
setup.generic.in.domain = domain;
|
setup.generic.in.domain = domain;
|
||||||
}
|
}
|
||||||
@ -121,8 +125,11 @@ NTSTATUS smbcli_send_tconX(struct smbcli_state *cli, const char *sharename,
|
|||||||
if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_USER_LEVEL) {
|
if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_USER_LEVEL) {
|
||||||
tcon.tconx.in.password = data_blob(NULL, 0);
|
tcon.tconx.in.password = data_blob(NULL, 0);
|
||||||
} else if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) {
|
} else if (cli->transport->negotiate.sec_mode & NEGOTIATE_SECURITY_CHALLENGE_RESPONSE) {
|
||||||
tcon.tconx.in.password = data_blob_talloc(mem_ctx, NULL, 16);
|
tcon.tconx.in.password = data_blob_talloc(mem_ctx, NULL, 24);
|
||||||
E_md4hash(password, tcon.tconx.in.password.data);
|
if (cli->transport->negotiate.secblob.length < 8) {
|
||||||
|
return NT_STATUS_INVALID_PARAMETER;
|
||||||
|
}
|
||||||
|
SMBencrypt(password, cli->transport->negotiate.secblob.data, tcon.tconx.in.password.data);
|
||||||
} else {
|
} else {
|
||||||
tcon.tconx.in.password = data_blob_talloc(mem_ctx, password, strlen(password)+1);
|
tcon.tconx.in.password = data_blob_talloc(mem_ctx, password, strlen(password)+1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user