summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb2/fileio.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2008-04-18 22:30:12 +0200
committerStefan Metzmacher <metze@samba.org>2008-04-19 01:54:45 +0200
commit8b5f03a225b7e3ab478f5de22e7a84e78c909741 (patch)
tree36e0a3deda0bc5df8f9455bb5e0070665e3772f6 /source4/smb_server/smb2/fileio.c
parent132852f44ac24824d2247d3d873f217c5b8207a9 (diff)
downloadsamba-8b5f03a225b7e3ab478f5de22e7a84e78c909741.tar.gz
samba-8b5f03a225b7e3ab478f5de22e7a84e78c909741.tar.bz2
samba-8b5f03a225b7e3ab478f5de22e7a84e78c909741.zip
smb_server/smb2: handle incoming oplock releases
metze (This used to be commit 2306394dcc22ff2be8581256a5cf91eef4993078)
Diffstat (limited to 'source4/smb_server/smb2/fileio.c')
-rw-r--r--source4/smb_server/smb2/fileio.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/source4/smb_server/smb2/fileio.c b/source4/smb_server/smb2/fileio.c
index af1a413009..b6b35d3d89 100644
--- a/source4/smb_server/smb2/fileio.c
+++ b/source4/smb_server/smb2/fileio.c
@@ -410,7 +410,36 @@ void smb2srv_notify_recv(struct smb2srv_request *req)
SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_notify(req->ntvfs, io));
}
+static void smb2srv_break_send(struct ntvfs_request *ntvfs)
+{
+ struct smb2srv_request *req;
+ union smb_lock *io;
+
+ SMB2SRV_CHECK_ASYNC_STATUS_ERR(io, union smb_lock);
+ SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x18, false, 0));
+
+ SCVAL(req->out.body, 0x02, io->smb2_break.out.oplock_level);
+ SCVAL(req->out.body, 0x03, io->smb2_break.out.reserved);
+ SIVAL(req->out.body, 0x04, io->smb2_break.out.reserved2);
+ smb2srv_push_handle(req->out.body, 0x08,io->smb2_break.out.file.ntvfs);
+
+ smb2srv_send_reply(req);
+}
+
void smb2srv_break_recv(struct smb2srv_request *req)
{
- smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED);
+ union smb_lock *io;
+
+ SMB2SRV_CHECK_BODY_SIZE(req, 0x18, false);
+ SMB2SRV_TALLOC_IO_PTR(io, union smb_lock);
+ SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_break_send, NTVFS_ASYNC_STATE_MAY_ASYNC);
+
+ io->smb2_break.level = RAW_LOCK_SMB2_BREAK;
+ io->smb2_break.in.oplock_level = CVAL(req->in.body, 0x02);
+ io->smb2_break.in.reserved = CVAL(req->in.body, 0x03);
+ io->smb2_break.in.reserved2 = IVAL(req->in.body, 0x04);
+ io->smb2_break.in.file.ntvfs = smb2srv_pull_handle(req, req->in.body, 0x08);
+
+ SMB2SRV_CHECK_FILE_HANDLE(io->smb2_break.in.file.ntvfs);
+ SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_lock(req->ntvfs, io));
}