]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4/smb_server: Fix handling of SMB2 messages after Netbios session setup
authorNoel Power <noel.power@suse.com>
Wed, 20 Nov 2019 16:32:59 +0000 (16:32 +0000)
committerRalph Boehme <slow@samba.org>
Thu, 5 Dec 2019 18:44:40 +0000 (18:44 +0000)
On receiving a special NBT packet (e.g. session setup) the samba daemon
effectively sets up SMB1 as the negotiated protocol (in terms of
software handling of the messages) even though no SMB protocol
has yet been negotiated. If the next message after the nbt session setup
is a SMB2 message it will be handled by the SMB1 callbacks and will be
rejected. This is evident when using smbclient (with -p 139) option
in an env where SMB1 cannot be negotiated [*]

This change doesn't set up the SMB1 callbacks on receipt of NBT special
messages but lets the generic callback in place. Once either SMB1 (or)
SMB2 is established (by receipt of a 'real' SMB or >=SMB2 message) then
the proper callbacks will be set as normal.

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Thu Dec  5 18:44:40 UTC 2019 on sn-devel-184

source4/smb_server/smb_server.c

index 45641a4f2c92884b2db037bfd2f08ed773e2a614..0b80f2fbd201422a4bfb0a9a883e4bceb89862dd 100644 (file)
@@ -44,7 +44,6 @@ static NTSTATUS smbsrv_recv_generic_request(void *private_data, DATA_BLOB blob)
        if (CVAL(blob.data,0) != 0) {
                status = smbsrv_init_smb_connection(smb_conn, smb_conn->lp_ctx);
                NT_STATUS_NOT_OK_RETURN(status);
-               packet_set_callback(smb_conn->packet, smbsrv_recv_smb_request);
                return smbsrv_recv_smb_request(smb_conn, blob);
        }