From: David Mulder Date: Tue, 15 Mar 2022 20:36:06 +0000 (-0600) Subject: smbd: Move send_break_message_smb1 to smb1_oplock.c X-Git-Tag: tevent-0.12.0~119 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bed19efa1c4e201aded2bd168a108d0a5ce0fea6;p=thirdparty%2Fsamba.git smbd: Move send_break_message_smb1 to smb1_oplock.c Signed-off-by: David Mulder Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/oplock.c b/source3/smbd/oplock.c index 3fa5691f96e..fe4d4831bfc 100644 --- a/source3/smbd/oplock.c +++ b/source3/smbd/oplock.c @@ -813,28 +813,6 @@ static void add_oplock_timeout_handler(files_struct *fsp) } } -static void send_break_message_smb1(files_struct *fsp, int level) -{ - struct smbXsrv_connection *xconn = NULL; - char break_msg[SMB1_BREAK_MESSAGE_LENGTH]; - - /* - * For SMB1 we only have one connection - */ - xconn = fsp->conn->sconn->client->connections; - - new_break_message_smb1(fsp, level, break_msg); - - show_msg(break_msg); - if (!srv_send_smb(xconn, - break_msg, false, 0, - IS_CONN_ENCRYPTED(fsp->conn), - NULL)) { - exit_server_cleanly("send_break_message_smb1: " - "srv_send_smb failed."); - } -} - /******************************************************************* This handles the generic oplock break message from another smbd. *******************************************************************/ diff --git a/source3/smbd/smb1_oplock.c b/source3/smbd/smb1_oplock.c index 496fba043a5..14e17fd3412 100644 --- a/source3/smbd/smb1_oplock.c +++ b/source3/smbd/smb1_oplock.c @@ -47,3 +47,25 @@ void new_break_message_smb1(files_struct *fsp, int cmd, SCVAL(result,smb_vwv3,LOCKING_ANDX_OPLOCK_RELEASE); SCVAL(result,smb_vwv3+1,cmd); } + +void send_break_message_smb1(files_struct *fsp, int level) +{ + struct smbXsrv_connection *xconn = NULL; + char break_msg[SMB1_BREAK_MESSAGE_LENGTH]; + + /* + * For SMB1 we only have one connection + */ + xconn = fsp->conn->sconn->client->connections; + + new_break_message_smb1(fsp, level, break_msg); + + show_msg(break_msg); + if (!srv_send_smb(xconn, + break_msg, false, 0, + IS_CONN_ENCRYPTED(fsp->conn), + NULL)) { + exit_server_cleanly("send_break_message_smb1: " + "srv_send_smb failed."); + } +} diff --git a/source3/smbd/smb1_oplock.h b/source3/smbd/smb1_oplock.h index a3a9cf5e509..a9b3c47b9dc 100644 --- a/source3/smbd/smb1_oplock.h +++ b/source3/smbd/smb1_oplock.h @@ -23,3 +23,4 @@ void new_break_message_smb1(files_struct *fsp, int cmd, char result[SMB1_BREAK_MESSAGE_LENGTH]); +void send_break_message_smb1(files_struct *fsp, int level);