mirror of
https://github.com/samba-team/samba.git
synced 2025-11-01 16:23:49 +03:00
r15760: - add RAW_READ_SMB2 => generic mapping
- Implement SMB2 Read metze
This commit is contained in:
committed by
Gerald (Jerry) Carter
parent
05ced31cb9
commit
d0ac0c5af4
@@ -148,9 +148,47 @@ void smb2srv_flush_recv(struct smb2srv_request *req)
|
||||
SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_flush(req->ntvfs, io));
|
||||
}
|
||||
|
||||
static void smb2srv_read_send(struct ntvfs_request *ntvfs)
|
||||
{
|
||||
struct smb2srv_request *req;
|
||||
union smb_read *io;
|
||||
|
||||
SMB2SRV_CHECK_ASYNC_STATUS(io, union smb_read);
|
||||
SMB2SRV_CHECK(smb2srv_setup_reply(req, 0x10, True, 0));
|
||||
|
||||
SMB2SRV_CHECK(smb2_push_o16s32_blob(&req->out, 0x02, io->smb2.out.data));
|
||||
SBVAL(req->out.body, 0x08, io->smb2.out.unknown1);
|
||||
SCVAL(req->out.body, 0x10, 0);
|
||||
|
||||
smb2srv_send_reply(req);
|
||||
}
|
||||
|
||||
void smb2srv_read_recv(struct smb2srv_request *req)
|
||||
{
|
||||
smb2srv_send_error(req, NT_STATUS_NOT_IMPLEMENTED);
|
||||
union smb_read *io;
|
||||
|
||||
SMB2SRV_CHECK_BODY_SIZE(req, 0x30, True);
|
||||
SMB2SRV_TALLOC_IO_PTR(io, union smb_read);
|
||||
SMB2SRV_SETUP_NTVFS_REQUEST(smb2srv_read_send, NTVFS_ASYNC_STATE_MAY_ASYNC);
|
||||
|
||||
io->smb2.level = RAW_READ_SMB2;
|
||||
io->smb2.in._pad = SVAL(req->in.body, 0x02);
|
||||
io->smb2.in.length = IVAL(req->in.body, 0x04);
|
||||
io->smb2.in.offset = BVAL(req->in.body, 0x08);
|
||||
io->smb2.in.file.ntvfs = smb2srv_pull_handle(req, req->in.body, 0x10);
|
||||
io->smb2.in.unknown1 = BVAL(req->in.body, 0x20);
|
||||
io->smb2.in.unknown2 = BVAL(req->in.body, 0x28);
|
||||
io->smb2.in._bug = CVAL(req->in.body, 0x30);
|
||||
|
||||
SMB2SRV_CHECK_FILE_HANDLE(io->smb2.in.file.ntvfs);
|
||||
|
||||
/* preallocate the buffer for the backends */
|
||||
io->smb2.out.data = data_blob_talloc(io, NULL, io->smb2.in.length);
|
||||
if (io->smb2.out.data.length != io->smb2.in.length) {
|
||||
SMB2SRV_CHECK(NT_STATUS_NO_MEMORY);
|
||||
}
|
||||
|
||||
SMB2SRV_CALL_NTVFS_BACKEND(ntvfs_read(req->ntvfs, io));
|
||||
}
|
||||
|
||||
static void smb2srv_write_send(struct ntvfs_request *ntvfs)
|
||||
|
||||
Reference in New Issue
Block a user