diff options
| author | Jeremy Allison <jra@samba.org> | 2014-11-26 13:33:57 -0800 |
|---|---|---|
| committer | Karolin Seeger <kseeger@samba.org> | 2014-12-04 21:55:15 +0100 |
| commit | 2bea37d47ab398bf282f62c9d59429ce54b4bb4e (patch) | |
| tree | aaa19494eb8da61e23011da474e375bcd9c32207 /libcli | |
| parent | 192fa109640e1f9bbb7b1845580c6f812c6900a3 (diff) | |
| download | samba-2bea37d47ab398bf282f62c9d59429ce54b4bb4e.tar.gz | |
libcli: SMB2: Pure SMB2-only negprot fix to make us behave as a Windows client does.
Required as some servers return zero when asked for
zero credits in an initial SMB2-only negprot.
Back-port of c426f97238e4f664d1b13781101ca9c942aa7d0d
from master.
https://bugzilla.samba.org/show_bug.cgi?id=10966
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(v4-1-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-1-test): Thu Dec 4 21:55:16 CET 2014 on sn-devel-104
Diffstat (limited to 'libcli')
| -rw-r--r-- | libcli/smb/smbXcli_base.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 25fbabd00d..0ceb1ddef8 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -31,6 +31,7 @@ #include "../libcli/smb/read_smb.h" #include "smbXcli_base.h" #include "librpc/ndr/libndr.h" +#include "local.h" struct smbXcli_conn; struct smbXcli_req; @@ -3791,6 +3792,16 @@ struct tevent_req *smbXcli_negprot_send(TALLOC_CTX *mem_ctx, */ conn->dispatch_incoming = smb2cli_conn_dispatch_incoming; + /* + * As we're starting with an SMB2 negprot, emulate Windows + * and ask for 31 credits in the initial SMB2 negprot. + * If we don't and leave requested credits at + * zero, MacOSX servers return zero credits on + * the negprot reply and we fail to connect. + */ + smb2cli_conn_set_max_credits(conn, + WINDOWS_CLIENT_PURE_SMB2_NEGPROT_INITIAL_CREDIT_ASK); + subreq = smbXcli_negprot_smb2_subreq(state); if (tevent_req_nomem(subreq, req)) { return tevent_req_post(req, ev); |
