summaryrefslogtreecommitdiff
path: root/source4/smb_server/smb2
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2007-05-14 11:50:51 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:52:24 -0500
commit4eb1c753ab03e6b3023142910bae21e424da2d4d (patch)
tree26458565c260627dc0b4a1cbc196d65facb1d33d /source4/smb_server/smb2
parenta42f78cd503c8fdb8c8de00f21a4bdc830478567 (diff)
downloadsamba-4eb1c753ab03e6b3023142910bae21e424da2d4d.tar.gz
samba-4eb1c753ab03e6b3023142910bae21e424da2d4d.tar.bz2
samba-4eb1c753ab03e6b3023142910bae21e424da2d4d.zip
r22843: pass smb2 lock requests to the ntvfs layer
metze (This used to be commit 7fa00381ef4981ddb8f8816c924b7bb81628f4e6)
Diffstat (limited to 'source4/smb_server/smb2')
-rw-r--r--source4/smb_server/smb2/fileio.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/source4/smb_server/smb2/fileio.c b/source4/smb_server/smb2/fileio.c
index 66e3f61ee2..8e420458be 100644
--- a/source4/smb_server/smb2/fileio.c
+++ b/source4/smb_server/smb2/fileio.c
@@ -156,6 +156,7 @@ static void smb2srv_read_send(struct ntvfs_request *ntvfs)
SMB2SRV_CHECK_ASYNC_STATUS(io, union smb_read);
SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x10, True, io->smb2.out.data.length));
+ /* TODO: avoid the memcpy */
SMB2SRV_CHECK(smb2_push_o16s32_blob(&req->out, 0x02, io->smb2.out.data));
SBVAL(req->out.body, 0x08, io->smb2.out.unknown1);
@@ -224,9 +225,39 @@ void smb2srv_write_recv(struct smb2srv_request *req)
SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_write(req->ntvfs, io));
}
+static void smb2srv_lock_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, 0x04, False, 0));
+
+ SSVAL(req->out.body, 0x02, io->smb2.out.unknown1);
+
+ smb2srv_send_reply(req);
+}
+
void smb2srv_lock_recv(struct smb2srv_request *req)
{
- smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED);
+ union smb_lock *io;
+
+ SMB2SRV_CHECK_BODY_SIZE(req, 0x30, False);
+ SMB2SRV_TALLOC_IO_PTR(io, union smb_lock);
+ SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_lock_send, NTVFS_ASYNC_STATE_MAY_ASYNC);
+
+ io->smb2.level = RAW_LOCK_SMB2;
+
+ io->smb2.in.unknown1 = SVAL(req->in.body, 0x02);
+ io->smb2.in.unknown2 = IVAL(req->in.body, 0x04);
+ io->smb2.in.file.ntvfs = smb2srv_pull_handle(req, req->in.body, 0x08);
+ io->smb2.in.offset = BVAL(req->in.body, 0x18);
+ io->smb2.in.count = BVAL(req->in.body, 0x20);
+ io->smb2.in.unknown5 = IVAL(req->in.body, 0x24);
+ io->smb2.in.flags = IVAL(req->in.body, 0x28);
+
+ SMB2SRV_CHECK_FILE_HANDLE(io->smb2.in.file.ntvfs);
+ SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_lock(req->ntvfs, io));
}
static void smb2srv_ioctl_send(struct ntvfs_request *ntvfs)