From: Jeremy Allison Date: Tue, 8 Mar 2022 01:47:15 +0000 (-0800) Subject: s3: smbd: Plumb in and use smbd_smb2_server_connection_read_handler() when server... X-Git-Tag: tevent-0.12.0~478 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=db94eefdd540e5c143f4ace9bde0bf689b089c97;p=thirdparty%2Fsamba.git s3: smbd: Plumb in and use smbd_smb2_server_connection_read_handler() when server min protocol > NT1 (i.e. SMB2-only). This will allow us to remove the SMB1 server specific code when we disable SMB1, and still retain the ability to negotiate up from SMB1 -> SMB2 for old clients. Signed-off-by: Jeremy Allison Reviewed-by: David Mulder Autobuild-User(master): David Mulder Autobuild-Date(master): Thu Mar 10 17:53:26 UTC 2022 on sn-devel-184 --- diff --git a/source3/smbd/process.c b/source3/smbd/process.c index 2d5c67c33ee..54b3bb88e01 100644 --- a/source3/smbd/process.c +++ b/source3/smbd/process.c @@ -2554,7 +2554,6 @@ static void smbd_server_connection_write_handler( /* TODO: make write nonblocking */ } -#if 0 static void smbd_smb2_server_connection_read_handler( struct smbXsrv_connection *xconn, int fd) { @@ -2669,7 +2668,6 @@ static void smbd_smb2_server_connection_read_handler( } return; } -#endif static void smbd_smb1_server_connection_read_handler( struct smbXsrv_connection *xconn, int fd) @@ -2759,8 +2757,13 @@ static void smbd_server_connection_handler(struct tevent_context *ev, return; } if (flags & TEVENT_FD_READ) { - smbd_smb1_server_connection_read_handler(xconn, + if (lp_server_min_protocol() > PROTOCOL_NT1) { + smbd_smb2_server_connection_read_handler(xconn, xconn->transport.sock); + } else { + smbd_smb1_server_connection_read_handler(xconn, + xconn->transport.sock); + } return; } }