1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

smbd: Move new_break_message_smb1 to smb1_oplock.c

Signed-off-by: David Mulder <dmulder@suse.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
David Mulder 2022-03-15 14:32:08 -06:00 committed by Jeremy Allison
parent feb6c59378
commit bb34663958
5 changed files with 76 additions and 20 deletions

View File

@ -702,28 +702,8 @@ NTSTATUS downgrade_lease(struct smbXsrv_client *client,
return status;
}
/****************************************************************************
Set up an oplock break message.
****************************************************************************/
#define SMB1_BREAK_MESSAGE_LENGTH (smb_size + 8*2)
static void new_break_message_smb1(files_struct *fsp, int cmd,
char result[SMB1_BREAK_MESSAGE_LENGTH])
{
memset(result,'\0',smb_size);
srv_set_message(result,8,0,true);
SCVAL(result,smb_com,SMBlockingX);
SSVAL(result,smb_tid,fsp->conn->cnum);
SSVAL(result,smb_pid,0xFFFF);
SSVAL(result,smb_uid,0);
SSVAL(result,smb_mid,0xFFFF);
SCVAL(result,smb_vwv0,0xFF);
SSVAL(result,smb_vwv2,fsp->fnum);
SCVAL(result,smb_vwv3,LOCKING_ANDX_OPLOCK_RELEASE);
SCVAL(result,smb_vwv3+1,cmd);
}
/****************************************************************************
Function to do the waiting before sending a local break.
****************************************************************************/

View File

@ -0,0 +1,49 @@
/*
Unix SMB/CIFS implementation.
oplock processing
Copyright (C) Andrew Tridgell 1992-1998
Copyright (C) Jeremy Allison 1998 - 2001
Copyright (C) Volker Lendecke 2005
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
#include "lib/util/server_id.h"
#include "locking/share_mode_lock.h"
#include "smbd/smbd.h"
#include "smbd/globals.h"
#include "messages.h"
#include "locking/leases_db.h"
#include "../librpc/gen_ndr/ndr_open_files.h"
/****************************************************************************
Set up an oplock break message.
****************************************************************************/
void new_break_message_smb1(files_struct *fsp, int cmd,
char result[SMB1_BREAK_MESSAGE_LENGTH])
{
memset(result,'\0',smb_size);
srv_set_message(result,8,0,true);
SCVAL(result,smb_com,SMBlockingX);
SSVAL(result,smb_tid,fsp->conn->cnum);
SSVAL(result,smb_pid,0xFFFF);
SSVAL(result,smb_uid,0);
SSVAL(result,smb_mid,0xFFFF);
SCVAL(result,smb_vwv0,0xFF);
SSVAL(result,smb_vwv2,fsp->fnum);
SCVAL(result,smb_vwv3,LOCKING_ANDX_OPLOCK_RELEASE);
SCVAL(result,smb_vwv3+1,cmd);
}

View File

@ -0,0 +1,25 @@
/*
Unix SMB/CIFS implementation.
oplock processing
Copyright (C) Andrew Tridgell 1992-1998
Copyright (C) Jeremy Allison 1998 - 2001
Copyright (C) Volker Lendecke 2005
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define SMB1_BREAK_MESSAGE_LENGTH (smb_size + 8*2)
void new_break_message_smb1(files_struct *fsp, int cmd,
char result[SMB1_BREAK_MESSAGE_LENGTH]);

View File

@ -34,6 +34,7 @@ struct dptr_struct;
#include "smbd/smb1_ipc.h"
#include "smbd/smb1_negprot.h"
#include "smbd/smb1_nttrans.h"
#include "smbd/smb1_oplock.h"
#endif
struct trans_state {

View File

@ -607,6 +607,7 @@ if bld.CONFIG_SET('WITH_SMB1SERVER'):
smbd/smb1_ipc.c
smbd/smb1_negprot.c
smbd/smb1_nttrans.c
smbd/smb1_oplock.c
'''
else:
SMB1_SOURCES = ''